parent
19f9d62425
commit
84d8fe2598
@ -0,0 +1,25 @@
|
||||
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 = []
|
||||
|
Loading…
Reference in new issue