Answered step by step
Verified Expert Solution
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 PURCHASEADULT PURCHASECHILD PURCHASEMOUSEEARS PURCHASEPARKING PURCHASEFOOD PRINTALL CALCTOTAL QUITCHOICE # The main function. def main: # The choice variable controls the loop # and holds the user's menu choice. choice costAdult costKid costEars costPark costFood while choice QUITCHOICE: # display the menu. displaymenu # Get the user's choice. choice intinputEnter your choice: # Perform the selected action. if choice PURCHASEADULT: costAdult purchaseAdult elif choice PURCHASECHILD: costKid purchaseKid elif choice PURCHASEMOUSEEARS: costEars purchaseEars elif choice PURCHASEPARKING: costPark purchaseParking; elif choice PURCHASEFOOD: costFood purchaseFood elif choice PRINTALL: printItcostAdultcostKidcostEarscostParkcostFood elif choice CALCTOTAL: calcTotalcostAdultcostKidcostEarscostParkcostFood elif choice QUITCHOICE: printExiting the program... else: printError: invalid selection. # The displaymenu function displays a menu. def displaymenu: print MENU' print Purchase adult tickets' print Purchase child tickets' print Purchase cool mouse ears' print Purchase parking' print Purchase food' print Print information' print Calculate total' print Quit' #purchaseAdult method returns how much the adult tickets will cost def purchaseAdult: COSTEACH # finish this #purhcaseKid function returns how much the kids tickets will cost def purchaseKid: COSTKID # finish this #purhcaseKid function returns how much the kids tickets will cost def purchaseEars: EARCOST # finish this # purchaseParking just returns for parking def purchaseParking: COSTPARKING #finish this # purchaseFood asks for the number of hot dogs and sodas, calculates the total cost # and returns this value def purchaseFood: COSTDOGS COSTSODA printWe have hot dogs $ each and soda $ each only" #printIt prints our each individual cost see sample output def printItcostA costK costE costP costF: print #finish this #calcTotal calculates and prints the total cost def calcTotalcostA costK costE costP costF: print # finish this # Call the main function. main SAMPLE OUTPUT::::: MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: How many adult tickets at $ each MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: How many kids tickets? at $ each MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: How many Mickey Mouse ears do you want? $ each MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: Parking will be $ MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: We have hot dogs $ each and soda $ each only How many hot dogs do you want? How many drinks do you want? MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: Cost adults tickets: $ Cost kids tickets: $ Cost mouse ears tickets: $ Cost parking: $ Cost food: $ MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: The total cost of your order is $ MENU Purchase adult tickets Purchase child tickets Purchase cool mouse ears Purchase parking Purchase food Print information Calculate total Quit Enter your choice: Exiting the program...
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
PURCHASEADULT
PURCHASECHILD
PURCHASEMOUSEEARS
PURCHASEPARKING
PURCHASEFOOD
PRINTALL
CALCTOTAL
QUITCHOICE
# The main function.
def main:
# The choice variable controls the loop
# and holds the user's menu choice.
choice
costAdult
costKid
costEars
costPark
costFood
while choice QUITCHOICE:
# display the menu.
displaymenu
# Get the user's choice.
choice intinputEnter your choice:
# Perform the selected action.
if choice PURCHASEADULT:
costAdult purchaseAdult
elif choice PURCHASECHILD:
costKid purchaseKid
elif choice PURCHASEMOUSEEARS:
costEars purchaseEars
elif choice PURCHASEPARKING:
costPark purchaseParking;
elif choice PURCHASEFOOD:
costFood purchaseFood
elif choice PRINTALL:
printItcostAdultcostKidcostEarscostParkcostFood
elif choice CALCTOTAL:
calcTotalcostAdultcostKidcostEarscostParkcostFood
elif choice QUITCHOICE:
printExiting the program...
else:
printError: invalid selection.
# The displaymenu function displays a menu.
def displaymenu:
print MENU'
print Purchase adult tickets'
print Purchase child tickets'
print Purchase cool mouse ears'
print Purchase parking'
print Purchase food'
print Print information'
print Calculate total'
print Quit'
#purchaseAdult method returns how much the adult tickets will cost
def purchaseAdult:
COSTEACH
# finish this
#purhcaseKid function returns how much the kids tickets will cost
def purchaseKid:
COSTKID
# finish this
#purhcaseKid function returns how much the kids tickets will cost
def purchaseEars:
EARCOST
# finish this
# purchaseParking just returns for parking
def purchaseParking:
COSTPARKING
#finish this
# purchaseFood asks for the number of hot dogs and sodas, calculates the total cost
# and returns this value
def purchaseFood:
COSTDOGS
COSTSODA
printWe have hot dogs $ each and soda $ each only"
#printIt prints our each individual cost see sample output
def printItcostA costK costE costP costF:
print
#finish this
#calcTotal calculates and prints the total cost
def calcTotalcostA costK costE costP costF:
print
# finish this
# Call the main function.
main
SAMPLE OUTPUT:::::
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
How many adult tickets at $ each
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
How many kids tickets? at $ each
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
How many Mickey Mouse ears do you want? $ each
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
Parking will be $
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
We have hot dogs $ each and soda $ each only
How many hot dogs do you want?
How many drinks do you want?
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
Cost adults tickets: $
Cost kids tickets: $
Cost mouse ears tickets: $
Cost parking: $
Cost food: $
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
The total cost of your order is $
MENU
Purchase adult tickets
Purchase child tickets
Purchase cool mouse ears
Purchase parking
Purchase food
Print information
Calculate total
Quit
Enter your choice:
Exiting the program...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started