Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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 ... 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

Operations Management Creating Value Along the Supply Chain

Authors: Roberta S. Russell, Bernard W. Taylor

7th Edition

9781118139523, 0470525908, 1118139526, 978-0470525906

More Books

Students also viewed these Programming questions

Question

Define belongingness, competence, and autonomy.

Answered: 1 week ago