You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
715 B

10 months ago
import datetime
class Room:
def __init__(self, room_number, room_type, rate, availability=True):
self.room_number = room_number
self.room_type = room_type
self.rate = rate
self.availability = availability
class Reservation:
def __init__(self, room, start_date, end_date):
self.room = room
self.start_date = start_date
self.end_date = end_date
self.total_cost = self.calculate_tatal_cost()
def calculate_total_cost(self):
days = (self.end_date - self.start_date).days
return days * self.room.rate
class Hotel:
def __init__(self, name):
self.name = name
self.rooms = []
self.reservations = []