Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python program named DisneyMenu. Fill in the code placed below for the functions. There is a separate document with sample output. Yours needs to match

Python program named DisneyMenu.
Fill in the code placed below for the functions. There is a separate document with sample output. Yours needs to match this.
Code :
'''
Put your comments here
'''
# Constants for the menu choices
PURCHASE_ADULT =1
PURCHASE_CHILD =2
PURCHASE_MOUSE_EARS =3
PURCHASE_PARKING =4
PURCHASE_FOOD =5
PRINT_ALL =6
CALC_TOTAL =7
QUIT_CHOICE =8
# The main function.
def main():
# The choice variable controls the loop
# and holds the user's menu choice.
choice =0
costAdult=0
costKid=0
costEars=0
costPark=0
costFood =0
while choice != QUIT_CHOICE:
# display the menu.
display_menu()
# Get the user's choice.
choice = int(input('Enter your choice: '))
# Perform the selected action.
if choice == PURCHASE_ADULT:
costAdult = purchaseAdult()
elif choice == PURCHASE_CHILD:
costKid = purchaseKid()
elif choice == PURCHASE_MOUSE_EARS:
costEars = purchaseEars()
elif choice == PURCHASE_PARKING:
costPark = purchaseParking();
elif choice == PURCHASE_FOOD:
costFood = purchaseFood()
elif choice == PRINT_ALL:
printIt(costAdult,costKid,costEars,costPark,costFood)
elif choice == CALC_TOTAL:
calcTotal(costAdult,costKid,costEars,costPark,costFood)
elif choice == QUIT_CHOICE:
print('Exiting the program...')
else:
print('Error: invalid selection.')
# The display_menu function displays a menu.
def display_menu():
print(' MENU')
print('1) Purchase adult tickets')
print('2) Purchase child tickets')
print('3) Purchase cool mouse ears')
print('4) Purchase parking')
print('5) Purchase food')
print('6) Print information')
print('7) Calculate total')
print('8) Quit')
#purchaseAdult() method returns how much the adult tickets will cost
def purchaseAdult():
COST_EACH =95.00
# finish this
#purhcaseKid() function returns how much the kids tickets will cost
def purchaseKid():
COST_KID =65.00
# finish this
#purhcaseKid() function returns how much the kids tickets will cost
def purchaseEars():
EAR_COST =9.00
# finish this
# purchaseParking() just returns 25 for parking
def purchaseParking():
COST_PARKING =25
#finish this
# purchaseFood() asks for the number of hot dogs and sodas, calculates the total cost
# and returns this value
def purchaseFood():
COST_DOGS =12
COST_SODA =6
print("We have hot dogs ($12.00 each) and soda ($6.00 each) only")
#printIt() prints our each individual cost (see sample output
def printIt(costA, costK, costE, costP, costF):
print()
#finish this
#calcTotal() calculates and prints the total cost
def calcTotal(costA, costK, costE, costP, costF):
print()
# finish this
# Call the main function.
main()
SAMPLE OUTPUT:::::
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 1
How many adult tickets (at $95.00 each)?5
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 2
How many kids tickets? (at $65.00 each)4
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 3
How many Mickey Mouse ears do you want? ($9.00 each)4
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 4
Parking will be $ 25.00
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 5
We have hot dogs ($12.00 each) and soda ($6.00 each) only
How many hot dogs do you want?6
How many drinks do you want?4
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 6
Cost adults tickets: $ 475.00
Cost kids tickets: $ 260.00
Cost mouse ears tickets: $ 36.00
Cost parking: $ 25.00
Cost food: $ 96.00
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 7
The total cost of your order is $ 892.00
MENU
1) Purchase adult tickets
2) Purchase child tickets
3) Purchase cool mouse ears
4) Purchase parking
5) Purchase food
6) Print information
7) Calculate total
8) Quit
Enter your choice: 8
Exiting the program...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago