454,654 Members | 1,519 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

# How can I do the checkIn and find room mothed ?

 P: 1 Expand|Select|Wrap|Line Numbers public class Hotel {       private Room[] rooms;               public Hotel() {         rooms = new Room[23];         int i = 0;         for(; i<5; i++) {             if (i%2==0) {                 rooms[i] = new Room(101+i, 2, "Queen", true, 150);             } else {                 rooms[i] = new Room(101+i, 1, "King", true, 135);             }         }         for(; i<20; i++) {             int number = (i/10+1)*100+1+i%10;             if (i%3==0) {                 rooms[i] = new Room(number, 1, "Queen", false, 100);             } else if (i%4==0) {                 rooms[i] = new Room(number, 1, "King", false, 125);             } else {                 rooms[i] = new Room(number, 2, "Double", false, 85);             }         }         for(; i<23; i++) {             rooms[i] = new Room(301+i%10, 4, "Queen", true, 500);         }     }     public void printRooms() {         for(int i=0; i