Provide a method checkIn(String name, int room) that puts the named person in the specified room, if the room is currently empty. If the room was available, return true, but if the room is already occupied, return false. 

provide a method isFull() which returns true if all of the rooms are occupied, otherwise false

انا عايزة أفهم methods كيف انفذها ع البرنامج :)

هي السؤال كامل

Write a Java program called Hotel.java to both provide a class to represent a hotel and a main method described below.

The hotel class should have at least one field, a String[][] holding the name of the person in each hotel room. (All of the rooms are singles.)

Provide a constructor which brings in two ints, one for number of floors and one for rooms per floor, and a default constructor which creates a Hotel with 3 floors and 10 rooms per floor.

Provide a method checkIn(String name, int room) that puts the named person in the specified room, if the room is currently empty. If the room was available, return true, but if the room is already occupied, return false. Provide a method checkOut(int room) to clear a room which returns nothing.

provide a method isFull() which returns true if all of the rooms are occupied, otherwise false.

Provide a method printEmpty() to print the numbers of the empty rooms in the hotel or print a message to the user "there isn't any empty room" if the hotel is full.

The main method of the program should ask the user for how many floors their hotel is, and then how many rooms per floor. There can be at most 99 rooms per floor, and at most 10 floors, and there must be at least one room and one room per floor. This input should be checked for validity; on invalid input the user should be reprompted. With this data for floors and rooms per floor, a Hotel object should be created.

The user is then repeatedly presented a menu which asks if they want to

  1. check a guest in
  2. check a guest out
  3. print empty rooms
  4. quit the program.

If the user says 1 and there are rooms available, prompt the user for a name and room number and attempt to add this guest to that room. Rooms are numbered such that the last two digits are the individual room number, and the preceeding digits specify the floor, such that room 305 is room 5 of the third floor, and 47 is room 47 on the zeroth floor. If this add is unsuccessful, prompt for a new room number. If there are no rooms available, notify the user of this case.

If the user says 2, prompt the user for a room number to vacate.

If the user says 3, print the numbers of the empty rooms in the hotel or print a message to the user "there isn't any empty room" if the hotel is full.

If the user says 4, exit the loop and finish the program.