Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void welcome() {
- System.out.println("Welcome to Hotel California");
- System.out.println("----------------------------");
- System.out.println("Do you want to register or log in?");
- System.out.println("[1] for registration");
- System.out.println("[2] to login");
- String input = scan.nextLine();
- if (input == "1") {
- register();
- } else if (input == "2") {
- logIn();
- } else {
- System.out.println("Did not understand input. Try again please");
- }
- }
- public void register() {
- System.out.print("Please enter your name: ");
- String name = scan.nextLine();
- System.out.print("Please enter a desired password: ");
- String pw = scan.nextLine();
- Guest g1 = new Guest(name, pw);
- // glist.add(g1);
- g1.setLoggedin(true);
- this.loggedIn = true;
- }
- public boolean logIn() {
- System.out.print("Please enter your name: ");
- String name = scan.nextLine();
- System.out.print("Please enter your password: ");
- String pw = scan.nextLine();
- // for (Guest singleguest : glist) { UDKOMMENTERET FORDI GLIST IKKE ER DET KORREKTE NAVN FOR LISTEN
- // if (singleguest.getName().equals(name)) {
- // if (singleguest.getPassword().equals(pw)) {
- // this.cuser = singleguest;
- // this.loggedIn = true;
- // }
- // }
- // }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement