Advertisement
Guest User

Untitled

a guest
Jan 11th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. System.out.println("Type your username: ");
  2. String username1 = reader.nextLine();
  3.  
  4. System.out.println("Type your password: ");
  5. String password1 = reader.nextLine();
  6.  
  7. if (username1.equals("alex")) {
  8. if (password1.equals("mightyducks")) {
  9. System.out.println("You are now logged into the system!");
  10. }
  11. }
  12.  
  13.  
  14. if (!(username1.equals("alex"))) {
  15. if(password1.equals("mightyducks")) {
  16. System.out.println("Your username or password was invalid!");
  17. }
  18. }
  19.  
  20. if (username1.equals("alex")) {
  21. if(!(password1.equals("mightyducks"))) {
  22. System.out.println("Your username or password was invalid!");
  23. }
  24. }
  25.  
  26. if (username1.equals("emily")) {
  27. if(password1.equals("cat")) {
  28. System.out.println("You are now logged into the system!");
  29. }
  30. }
  31.  
  32. if (!(username1.equals("emily"))) {
  33. if (password1.equals("cat")) {
  34. System.out.println("Your username or password was invalid!");
  35.  
  36. }
  37. }
  38.  
  39. if (username1.equals("emily")) {
  40. if (!(password1.equals("cat"))) {
  41. System.out.println("Your username or password was invalid!");
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement