Question: JAVA - Please read ALL instructions. Implement the following Userclass: State Three string variables for username, password, and a password hint Behavior 1.) A constructor

JAVA - Please read ALL instructions.

Implement the following Userclass:

State

Three string variables for username, password, and a password hint

Behavior

1.) A constructor that accepts three string arguments that are used to initialize the above three instance variables (in the above order)

2.) getUsername and getHint methods (you shold not have a getPassword method).

3.) a verifyPassword method that accepts a string and returns true/false depending on whether the parameter matches the User's password

4.) a toString method that returns User username.

5.) the usual read method (i.e., accepts a Scanner, reads in the username, password, and hint from a file and uses them to create and return a new User object).

The name of your class should be DataChecker.

Your class is tested by a UserApp class that reads in Users from a file using your read method, print out the User using your toString, and makes sure the password is not the same as the username by calling verifyPassword passing it the username.

For example, if the file users.data contains:

weiss puppy2 woof-woof arnow java cuppa tenenbaum tenenbaum da-same sokol brooklyn college 

Here are sample executions of the program:. User input is in bold. Your program should replicate the prompts and output:

username? arnow password? java Welcome to the system

username? weiss password? dontremember *** Invalid password - hint: woof-woof username? weiss password? puppy2 Welcome to the system

username? sokol password? CUNY *** Invalid password - hint: college username? sokol password? SUNY *** Invalid password - hint: college username? sokol password? BC *** Invalid password - hint: college Too many failed attempts... please try again later

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!