Answered step by step
Verified Expert Solution
Question
1 Approved Answer
HashMap Lab John is creating a website login page. He needs your help implement an application that will validate usemame and password. You need to
HashMap Lab
John is creating a website login page. He needs your help implement an application that will validate usemame and password. You need to write a program that will read a data.txt file that contains the full name, username, and password.
Create a HashMap that holds username as key and the password as value.
Create another HashMap that holds the username as key and full name as value.
After the file is read, prompt the user to enter the username and password. If the password is incorrect, give the user two more chances. If the password is incorrect all three times, the program quits.
If the login is successful, print a welcome message. Use the first HashMap to check the username and password match and use the second HashMap to print the welcome message.
Here is data.trt file
tableReynaldo Hubbard rhunnard,gwerty Jeffrey Roy,jroy,pasMarcus Rocha,mrocha,p word
Step 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