예제 #1
0
  public static void addGuest() throws IOException, Exception {
    // Get guestname, address
    System.out.println("Enter the guest's full name:");
    String name = bufferRead.readLine();

    while (!Guest.isNameValid(name)) {
      System.out.println(
          "Invalid: Please enter a non-empty value that is " + "less than 30 characters: ");
      name = bufferRead.readLine();
    }

    System.out.println("Enter the guest's address");
    String address = bufferRead.readLine();

    // call add guest
    Guest.add(conn, name, address);

    return;
  }