(Solved) : Write Java Program Goal Assignment Mimic User Login Java Console Application Prompt User U Q42734065 . . .

Write a Java Program The goal for this assignment will be to mimic a user login from a Java console application. You will proWrite a Java Program Sample Output A match is found when two conditions are met: 1. The inputted username is a case insensiti

Write a Java Program The goal for this assignment will be to mimic a user login from a Java console application. You will prompt a user for a username and a password, and then use the inputs you receive to validate whether or not the username/password combination is valid In order to validate this username / password combination, you’ll need to read this information from a file (called “data.txt”) and import the data into your Java application Data.txt test@email.com, passwordTest!1, Test User another@user.com, asdfasdf ,Another User john.doe@mydomain.net, Hdk398jf!, John Doe jane. doe@myotherdomain.com, sunrise-sunset, Jane Doe You should create a User POJO that will store the information that will be read from the file. The User POJO should contain three properties: 1. username 2. password 3. name The file information should be stored in your Java application as an Array of User objects. Once this data is appropriately stored in your Java application, you can begin the process of prompting for username and password. Using a Scanner, you can ask the user for a username and password (this is kind of like a real-world application where you would be presented with a login screen). But for our purposes, we’ll be using the console to collect the user’s input. Once you’ve collected a username and a password via your Scanner, you can begin the process of validating this input against our Array of User objects. You will need to iterate through the User objects and check to see if the username/password inputs that you received via the Scanner match any of the User objects in your Array. See the “Determining a Match” section below for info on how to determine if there’s a valid match or not. If a match is found then you should display a message that says: Welcome insert user’s name here} Note: you should populate the [insert user’s name here) portion with the name of the User which matches the inputted username/password. Once a user has successfully logged in, the program can terminate. If no match is found then you should display a message that says: Invalid login, please try again. In the event that there’s an invalid login attempt, the user should only be given 5 chances in total to login. If the user fails to login after their 5th attempt, the program should output a message that states: Too many failed login attempts, you are now locked out And the program should terminate. Write a Java Program Sample Output A match is found when two conditions are met: 1. The inputted username is a case insensitive match with the username property in the User object 2. The inputted password is a case sensitive match with the password property in the User object. Use Case #1: User attempts too many failed logins and is locked out Enter your email: test@test.com Enter your password: editasdf Invalid login, please try again Enter your email: test@test.com Enter your password: asdasd Invalid login, please try again Enter your email: test@test.com Enter your password: aliasdf Invalid login, please try again Enter your email: test@test.com Enter your password: asdasd Invalid login, please try again Too many failed login attempts, you are now locked out. Use Case #2 User successfully logs in Enter your email: testtest.com Enter your password: andfasdf Invalid login, please try again Enter your email: john.doe@mydomain.net Enter your password: Hdk398jf! Welcome: John Doe Show transcribed image text Write a Java Program The goal for this assignment will be to mimic a user login from a Java console application. You will prompt a user for a username and a password, and then use the inputs you receive to validate whether or not the username/password combination is valid In order to validate this username / password combination, you’ll need to read this information from a file (called “data.txt”) and import the data into your Java application Data.txt test@email.com, passwordTest!1, Test User another@user.com, asdfasdf ,Another User john.doe@mydomain.net, Hdk398jf!, John Doe jane. doe@myotherdomain.com, sunrise-sunset, Jane Doe You should create a User POJO that will store the information that will be read from the file. The User POJO should contain three properties: 1. username 2. password 3. name The file information should be stored in your Java application as an Array of User objects. Once this data is appropriately stored in your Java application, you can begin the process of prompting for username and password. Using a Scanner, you can ask the user for a username and password (this is kind of like a real-world application where you would be presented with a login screen). But for our purposes, we’ll be using the console to collect the user’s input. Once you’ve collected a username and a password via your Scanner, you can begin the process of validating this input against our Array of User objects. You will need to iterate through the User objects and check to see if the username/password inputs that you received via the Scanner match any of the User objects in your Array. See the “Determining a Match” section below for info on how to determine if there’s a valid match or not. If a match is found then you should display a message that says: Welcome insert user’s name here} Note: you should populate the [insert user’s name here) portion with the name of the User which matches the inputted username/password. Once a user has successfully logged in, the program can terminate. If no match is found then you should display a message that says: Invalid login, please try again. In the event that there’s an invalid login attempt, the user should only be given 5 chances in total to login. If the user fails to login after their 5th attempt, the program should output a message that states: Too many failed login attempts, you are now locked out And the program should terminate.
Write a Java Program Sample Output A match is found when two conditions are met: 1. The inputted username is a case insensitive match with the username property in the User object 2. The inputted password is a case sensitive match with the password property in the User object. Use Case #1: User attempts too many failed logins and is locked out Enter your email: test@test.com Enter your password: editasdf Invalid login, please try again Enter your email: test@test.com Enter your password: asdasd Invalid login, please try again Enter your email: test@test.com Enter your password: aliasdf Invalid login, please try again Enter your email: test@test.com Enter your password: asdasd Invalid login, please try again Too many failed login attempts, you are now locked out. Use Case #2 User successfully logs in Enter your email: testtest.com Enter your password: andfasdf Invalid login, please try again Enter your email: john.doe@mydomain.net Enter your password: Hdk398jf! Welcome: John Doe

Expert Answer


Answer to Write a Java Program The goal for this assignment will be to mimic a user login from a Java console application. You wil…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?