Question: CODE IN JAVA Task Create a class named Account that contains the string fields name, email, and password. Your constructor(s) must check that an email
CODE IN JAVA


Task Create a class named Account that contains the string fields name, email, and password. Your constructor(s) must check that an email is valid. Include a tostring method in your class. For simplicity, we assume that a valid email contains a name, followed by @, followed by one or more characters. Develop a program called Loginsim that simulates a login procedure. The program reads a list of names, email addresses and passwords from a file pw.txt. Store the information in an ArrayList of Account objects. Note: place the file in a test folder and access with new File("test/pw.txt"). The names are included in the email addresses (before @). Your program will prompt the user for their email address. If the email is not in the system, prompt the user to try again. Give them an option to quit. If the email is found in the system, prompt the user to enter their password. After 3 unsuccessful tries, inform the user that they are locked out and end the program. If the password matched, welcome the user by name and ask if they would like to change their password. If so, prompt for the new password and change it accordingly. If not, end the program by confirming that they have signed out. When the program ends, display the list of account. Sample output 1: Enter your email address (a to quit): dave@chipmunks.com Enter your password yhsjao722!j s Welcome Dave! Do you want to change your password (y)? y Enter new password winni134 Your password has been updated. List of accounts Simon@chipmunks.com password123 Theodore@chipmunks.com 222 Dave@chipmunks.com winni134 Alvin@chipmunks.com labtesti Sample output 2: Enter your email address (a to quit): stehp@chipmunks.com Email not found, please try again (9 to quit) Jamieson@chipmunks.com Email not found, please try again (a to quit) a Goodbye! Sample output 3: Enter your email address (a to quit): dave@chipmunks.com Enter your password dhehnsB1 Password incorrect, please try again Enter your password Yhansoiwl Password incorrect, please try again Enter your password Notthird! 3 strikes, locked out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
