Question
In this Java program, you are supposed to create a log-in system for a company. You must use a multi-dimensional array to complete this assignment.
In this Java program, you are supposed to create a log-in system for a company. You must use a multi-dimensional array to complete this assignment. Create a multi-dimensional matrix with three rows and ten columns. This multi-dimensional array will act like a database for this login system. Ten columns will store the login information of ten different users. The first row should contain the usernames of ten users, the second row should contain the password of corresponding users from row one. The third row should contain the last four digits of social security number of the user. Be creative with the usernames and passwords.
First row is for the usernames, second row is for the passwords, and the third row is for the SSN. On startup, your program will prompt the user to enter the username, then the password. The program will then check its database to find the username, if the username doesnt exist, then the program will produce an error message and exit. If the username exists, then the program will check if the password entered matches the password in the database or not. If the password matches with the password in the system, then you can generate a message saying that the login was successful. If the password doesnt match the password in the system, then you ask the user to re-enter the password. If the new password matches the password in the system, you can generate a message saying that the login was successful. If the user fails to provide the correct password at the second attempt, then you should ask the user for the last four digits of their social security number. If the user can provide the correct last four digits of social security number, then you should display their password. If the user types wrong last four digits of social security number then, the program should generate an error message asking the user to contact the administrator and system should exit. You MUST write three different methods other than the main method to check the username, to check the password, and to check the SSN. To exit the system, you can use System.exit(1) method.
The output should be identical to the following
Sample output :-
Sample Database: cookiemonster teriyakizmarsalaironman minion foxy fox blahblah madman shakiraLBJ23 atethecookie chickenz thailand isthehero iscute idontknow haha beware pique cleveland 0234 1234 2234 3234 4234 5234 6234 7234 8234 9234 First row is for the usernames, second row is for the passwords, and the third row is for the SSNStep 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