Question: Python program (not using any functions): You have been asked to write a program that calculates the total price for a picnic lunch that the

Python program (not using any functions):

You have been asked to write a program that calculates the total price for a picnic lunch that the user is purchasing for a group of friends.

Your program should:

Ask the user to enter her budget for the lunch

The user 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 as constant variables.

Use a nested repetition/selection structure to ask the user what type of item and how much of each item he/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 users budget.

Additionally, provide a sentinel value that allows the user to exit the purchasing loop at any time.

After the loop is exited, display the total amount spent, the total amount of each item purchased (quantity and cost) and the amount of the budget that remains.

Be sure to include appropriate documentation at the start of the program and within the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!