Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Incorrect username or password. Try Again!
- int check = 0;
- while(check == 0)
- {
- screen.displayString("Enter the username: ");
- String usernameLogin = keypad.getString();
- screen.displayString("Enter the password: ");
- String passwordLogin = keypad.getString();
- for (int i = 0; i < users.size(); i++) {
- if (users.get(i).getUsername().equals(usernameLogin) && users.get(i).getPassword().equals(passwordLogin)) {
- no = users.get(i).getId();
- check = 1;
- break;
- }
- else
- {
- check = 0;
- }
- }
- if(check == 1)
- {
- break;
- }
- if (manager.getUsername().equals(usernameLogin) && manager.getPassword().equals(passwordLogin)) {
- no = manager.getId();
- check = 1;
- break;
- }
- else {
- check = 0;
- }
- if(check==0)
- {
- screen.displayStringLine("Incorrect username or password. Try Again!");
- }
- }
Add Comment
Please, Sign In to add comment