Advertisement
argentine111

Untitled

Jan 23rd, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Usernames {
  4.  
  5. public static void main(String[] args) {
  6. Scanner reader = new Scanner(System.in);
  7.  
  8. System.out.println("Type your username: ");
  9. String username = reader.nextLine();
  10. System.out.println("Type your password: ");
  11. String password = reader.nextLine();
  12. String user = "alex";
  13. String userTwo = "emily";
  14. String pass = "mightyducks";
  15. String passTwo = "cat";
  16.  
  17. if (username.equals(user) && (password.equals(pass))) {
  18. System.out.println("You are now logged into the system!");
  19. }else if(username.equals(userTwo) && (password.equals(passTwo))) {
  20. System.out.println("You are now logged into the system!");
  21. }else{
  22. System.out.println("Your username or password was invalid!");
  23.  
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement