Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago

Question

recognise typical interviewer errors and explain how to avoid them

Answered: 1 week ago

Question

identify and evaluate a range of recruitment and selection methods

Answered: 1 week ago

Question

understand the role of competencies and a competency framework

Answered: 1 week ago