-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestaurant.py
66 lines (48 loc) · 1.89 KB
/
restaurant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class Restaurant():
"""Name and cuisine type."""
def __init__(self, restaurant_name, cuisine_type):
"""Name and type."""
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
self.number_served = 0
def describe_restaurant(self):
"""Name and type of restaurant."""
print("\nThe " + self.restaurant_name.title() + ", is a " +
self.cuisine_type.title() + " restaurant.")
def open_restaurant(self):
"""Indicate status of restaurant."""
print(self.restaurant_name.title() + " is now open.")
def restaurant(self):
print(" This restaurant has served" + ", "
+ str(self.number_served) + " customers.")
def update_restaurant(self, numbers):
"""Update the customers served."""
self.number_served = numbers
def increment_number_served(self, daily):
"""Adding daily number of customers."""
self.number_served += daily
class IceCreamStand(Restaurant):
"""Ice cream stand."""
def __init__(self, restaurant_name, cuisine_type):
"""Restaurant class."""
def ice_cream_flavors(self, flavors):
"""Ice cream flavours."""
self.flavor = vanilla
my_ice_cream_stand = IceCreamStand('iceman', 'icecream')
my_restaurant = Restaurant('blue lagoon', 'japanese')
my_restaurant.describe_restaurant()
my_restaurant.open_restaurant()
my_restaurant.restaurant()
old_restaurant = Restaurant("kibanda", "fast-food")
old_restaurant.describe_restaurant()
old_restaurant.open_restaurant()
old_restaurant.update_restaurant(100)
old_restaurant.restaurant()
new_restaurant = Restaurant("veggie", "vegeterian")
new_restaurant.describe_restaurant()
new_restaurant.open_restaurant()
new_restaurant.restaurant()
new_restaurant.update_restaurant(10)
new_restaurant.restaurant()
new_restaurant.increment_number_served(200)
new_restaurant.restaurant()