Question: In python This time, we want to print the menu and then let the user select an item by number or name. If their selection
In python This time, we want to print the menu and then let the user select an item by number or name. If their selection is on the menu, we'll print a message letting them know we've put in their order; we'll keep asking them to select an option until they pick something on the menu. Requirements
how to write program to do the following:
Set a constant called MENU, with the value: ham "eggs", "bacon", "fish", "toast", "spam", "fruit"
Print a message welcoming the user to the cafUnlike assignment you don't have to print the number of items on the menu, but you can if you like!
Print a numbered list of items on the menu for the user. a Remember to make the item list start at and not
Prompt the user to select an item from the menu by entering either the item number or the item name.
Check the user's selection to make sure they've picked an option on the menu. a If entering by name, case must not matter: Eggs, eggs, and EgGs are all valid selections.
If the user's selection is not on the menu, print an error message, and then loop and reprompt the user until they have made a valid selection.
Once the user has made a valid selection, print a message that includes the name of the food item and letting the user know an order is placed for them, then exit the program.
Sample Output
Welcome to the Breakfast Caf
Please select a menu item:
ham
eggs
bacon
fish
toast
spam
fruit
Your order? salmon
Sorry, I don't think we carry that.
Please select a menu item: ham eggs bacon fish toast spam fruit Your order? EgGs
A delicious order of eggs has been put in for you!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
