Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hotelcalifornia;
- import java.util.ArrayList;
- import java.util.Scanner;
- /**
- *
- * @author Lovro
- */
- public class HotelCalifornia {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Boolean con = true;
- System.out.println("Welcome to Hotel California");
- registration();
- }
- public static void registration() {
- Scanner s = new Scanner(System.in);
- Customer c = new Customer();
- Boolean con = true;
- System.out.println("If you want to check our rooms, you have to register!");
- String answer = s.nextLine();
- while (con) {
- System.out.println("-----REGISTRATION-----");
- System.out.println("Insert your name: ");
- c.setName(s.nextLine());
- System.out.println("Insert your password: ");
- c.setPassword(s.nextLine());
- System.out.println("Your name is: " + c.getName());
- System.out.println("Your password is: " + c.getPassword());
- System.out.println("-----LOGIN-----");
- System.out.println("Your name: ");
- String name = s.nextLine();
- System.out.println("Your password: ");
- String password = s.nextLine();
- if (name.equals(c.getName()) && password.equals(c.getPassword())) {
- System.out.println("You have now logged in as " + c.getName());
- System.out.println(c.getPassword());
- break;
- } else if (name != c.getName() || password != c.getPassword()) {
- System.out.println("You have entered wrong name and/or password, you have to register first!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement