Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IT'S A JAVA QUESTION ------------------------------------------------------------------------------------ pw.txt Simon@chipmunks.com password123 Theodore@chipmunks.com 222 Dave@chipmunks.com yhsjao722!j$ Alvin@chipmunks.com labTest1 Create a class named Account that contains the string fields name,
IT'S A JAVA QUESTION
------------------------------------------------------------------------------------
pw.txt
Simon@chipmunks.com password123 Theodore@chipmunks.com 222 Dave@chipmunks.com yhsjao722!j$ Alvin@chipmunks.com labTest1
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 (q to quit): dave@chipmunks.com Enter your password yhsja0722!; $ 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 (q to quit): stehp@chipmunks.com Email not found, please try again (q to quit) Jamieson@chipmunks.com Email not found, please try again (9 to quit) a Goodbye! Sample output 3: Enter your email address (q 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 outStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started