Module sc2002_fypms
Package controllers

Class UserController

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Scanner sc
      Scanner object to get input from the user.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean changePassword()
      Changes the user's password by prompting for their old and new passwords.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sc

        private static final java.util.Scanner sc
        Scanner object to get input from the user.
    • Constructor Detail

      • UserController

        public UserController()
        Constructs an instance of the UserController class.
    • Method Detail

      • changePassword

        protected boolean changePassword()
        Changes the user's password by prompting for their old and new passwords. If the old password matches the current one and the new password is different, the change is successful. The password change fails in the following scenarios:
        1. The old password does not match the current password
        2. The new password is the same as the old password
        3. The user decides to quit the process by entering "X"
        Returns:
        true if the password change is successful, false otherwise