Question: Write a program that starts off with a predefined set of Food Items and their Prices entered into a dictionary as key-value pairs (see below
Write a program that starts off with a predefined set of Food Items and their Prices entered into a dictionary as key-value pairs (see below for startup pre-entered data). The program should display a menu and not exit the program/menu until the user decides to exit.
The menu choices should allow user to do the following (Use the same order):
1) Display all the Food Items and Prices in the dictionary
2) Display how many Food Items are in the dictionary
3) Display all the Food Items names only in the dictionary
4) Display all the Food Items with Prices under $4.50 only in the dictionary
5) Look up a Food Item and display its price. If not found display ‘Food Item not found’
6) Confirm that a Food Item is in the dictionary
7) Add a Food Item and its Price into the dictionary
8) Change a Food Item’s Price in the dictionary
9) Remove a Food Item and its Price from the dictionary
10)Remove all Food Items and Prices from the dictionary
11) Exit the program menu
The following dictionary items (9) should exist in the program on the startup of the program:
Single meat hamburger: $4.09
Double meat hamburger: $5.59
Cheeseburger: $4.64
Bacon cheeseburger: $5.74
Chicken sandwich: $4.94
Chicken tenders: $4.49
French fries: $2.29
Onion rings: $2.79
Soft drink: $2.14
Step by Step Solution
3.48 Rating (158 Votes )
There are 3 Steps involved in it
Sure Heres an example program in Python that implements the menu functionality based on the provided requirements python Predefined dictionary of food items and prices fooditems Single meat hamburger ... View full answer
Get step-by-step solutions from verified subject matter experts
