Question: Java: please help with the following class. Thank you. Account class Superclass Instance variables clearPassword String Must be at least 8 characters long encryptedPassword :

Java: please help with the following class. Thank you.

  1. Account class
    1. Superclass
    2. Instance variables
      1. clearPassword
        1. String
        2. Must be at least 8 characters long
      2. encryptedPassword : String
      3. key
        1. int
        2. Must be between 1 and 10(inclusive)
      4. accountId - A unique integer that identifies each account
      5. nextIDNum a static int that starts at 1000 and is used to generate the accountID
      6. no other instance variables needed.
    3. Default constructor set all instance variables to a default value.
    4. Parameterized constructor
      1. Takes in clearPassword, key.
      2. Calls encrypt method to create encryptedPassword
    5. setClearPassWord(String newPassword)
      1. Takes in a new clear text password.
      2. Calls encrypt method as the encrypted password would need to change.
    6. no encryptedPassword mutator method
    7. setKey(int newKey)
      1. Takes in a new key
      2. calls encrypt method as the encrypted password would need to change.
    8. accountId mutator - uses the static variable nextIDNum to retrieve the next available userID number
    9. encrypt method
      1. Uses the instance variables clearPassword and key to encrypt the password.
      2. Stores the encrypted password in the encryptedPassword instance variable
    10. toString - returns a nicely formatted String representing the instance variables of the Account class

NOTE: Your Account class should ensure the clearPassword is valid as described in the requirements. If not write an error message to the standard output and continue. Set the clearPassword and encyrptedPassword to the empty String.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!