Advertisement
Guest User

Untitled

a guest
Sep 5th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Kayttajatunnukset {
  4.  
  5. public static void main(String[] args) {
  6. Scanner reader = new Scanner(System.in);
  7. System.out.println("Type your username: ");
  8. String userName = reader.nextLine();
  9. // System.out.println(userName);
  10. System.out.println("Type your password: ");
  11. String password = reader.nextLine();
  12. // System.out.println(password);
  13. if ((userName.equals("alex") && password.equals("mightyducks")) || (userName.equals("emily") && password.equals("cat"))) {
  14. System.out.println("You are now logged into the system!");
  15. } else {
  16. System.out.println("Your username or password was invalid!");
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement