Code
class Dinner_combo():
def __init__(self):
self.main_dish=""
self.soup=""
self.total=0
def choose_dish(self):
choice=input("Enter 1 for sweet and sour pork [$7], 2 for sesame
chiken [$8] or 3 shrimp fried rice [$9]:")
if(choice=="1"):
print("hi")
self.main_dish="sweet and sour pork"
self.total+=7
if(choice=="2"):
self.main_dish="sesame chiken"
self.total+=8
if(choice=="3"):
self.main_dish="shrimp fried rice"
self.total+=9
def choose_soup(self):
choice=input("Enter 1 for egg drop soup [$1.25] or 2 for wanton
soup [$1.50] : ")
if(choice=="1"):
self.soup="egg drop soup"
self.total+=1.25
if(choice=="2"):
self.soup="wanton soup"
self.total+=1.50
def display_oprder(self):
print("Item ordered: "+self.soup+" , "+self.main_dish)
print("Please pay thi amount: ",self.total)
class Deluxe_dinner_combo(Dinner_combo):
def __init__(self):
Dinner_combo.__init__(self)
self.appetizer=""
def choose_appetizer(self):
choice=input("Enter 1 for spring roll [$1.25] or 2 for chiken wing
[$1.50] : ")
if(choice=="1"):
self.appetizer="spring roll"
self.total+=1.25
if(choice=="2"):
self.appetizer="chiken wing"
self.total+=1.50
def display_oprder(self):
print("Item ordered: "+self.appetizer+" , "+self.soup+" ,
"+self.main_dish)
print("Please pay thi amount: ",self.total)
def main():
choice=input("Enter 1 for dinner combo and 2 for deluxe dinner
combo: ")
if(choice=="1"):
d1=Dinner_combo()
d1.choose_soup()
d1.choose_dish()
d1.display_oprder()
if(choice=="2"):
d2=Deluxe_dinner_combo()
d2.choose_appetizer()
d2.choose_soup()
d2.choose_dish()
d2.display_oprder()
main()
output
code snaps
If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.
INSTRUCTION AND PROBLEMS Create a Python project for each of the following problems. Zip each Pyt...
*****************USING JAVA AND JAVA FX **************
PLEASE READ THE INSTRUCTIONS BEFORE YOU GO AND DO IT SOME OTHER
WAY...
home / study / engineering / computer science / questions and
answers / *****in java & java fx***** a restaurant wants
...
Your question has been answered! Rate it below.
Let us know if you got a helpful answer.
Question
*****IN JAVA & JAVA FX*****
A restaurant wants an application that calculates a table’s
bill.
The design should include:
Group Boxes,...
A Chinese restaurant wants to have a computer-based search system that will display a recipe for each dish. The owner of the restaurant wants the system to be flexible in that its recipes are stored in a text file. This way, the number of dishes can be expanded by adding more entries to the text file without changing any program code. After analyzing the coding the restaurant realizes that Current coding only outputs first two line of the recipe. Goal:...