In Python    Propose a menu-driven program that calculates the total price for a picnic lunch that the user is purchasing for a group of friends. The user is first asked to enter her budget for the lunch. She/he has the option of buying apples, cheese, and bread. Set the price per apple, price per pound of cheese, and price per loaf of bread in constant variables. Use a nested repetition/selection structure to ask the user what type of item and how much of each item she would like to purchase. Keep a running total of the items purchased inside the loop. Exit the loop if the total has exceeded the user’s budget. In addition, provide a sentinel value that allows the user to exit the purchasing loop at any time Either Pseudo code or flow chart

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

In Python 

 

Propose a menu-driven program that calculates the total price for a picnic lunch that the user is purchasing for a group of friends.

  • The user is first asked to enter her budget for the lunch. She/he has the option of buying apples, cheese, and bread.
  • Set the price per apple, price per pound of cheese, and price per loaf of bread in constant variables.
  • Use a nested repetition/selection structure to ask the user what type of item and how much of each item she would like to purchase.
  • Keep a running total of the items purchased inside the loop. Exit the loop if the total has exceeded the user’s budget. In addition, provide a sentinel value that allows the user to exit the purchasing loop at any time

Either Pseudo code or flow chart

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Structure chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage