Exemplo n.º 1
0
 def addReservation(self, occupantName, smoking, bedtype):
     notFound = True
     for i in range(len(self.theRooms)):
         if (Room.get__BedType(self.theRooms[i]) == bedtype) and (
                 Room.get__Smoking(self.theRooms[i]) == smoking) and (Room.isOccupied(self.theRooms[i]) == False):
             Room.set_Occupied(self.theRooms[i], True)
             Room.set_Occupant(self.theRooms[i], occupantName)
             self.occupiedCnt += 1
             print(
                 f'Room is reserved for {occupantName}\nRoom# {i}\nbedType: {Room.get__BedType(self.theRooms[i])}\nSmoking: {smoking}\n')
             break
         if (len(self.theRooms) == i + 1):
             print('Sorry, There is no room available as per requirement')