Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using the Python language that allows the user to create the perfect ice cream sundae. The program needs to ask the user

  • Write a program using the Python language that allows the user to create the perfect ice cream sundae. The program needs to ask the user what toppings they would like until they enter Q to quit. Additionally it needs to accumulate the costs of these toppings in order to calculate a total. The base price for a sundae is $5. The toppings are as follows:
    • Hot Fudge = $2.00
    • Carmel = $2.25
    • Peanuts = $.5
    • Brownie = $1.00
    • Whipped Cream = $0.75

To make the input much easier have the user enter F for Fudge, C for Carmel, P for Peanuts, B for Brownie, W for Whipped Cream or Q for Quit.

Within the program create a constant to contain the base cost of a sundae. The program needs to print out the total cost of all of the toppings and the total cost of the sundae. A sample of the output will look like:

Enter F for Fudge, C for Carmel, P for Peanuts, B for Brownie, W for Whipped Cream or Q for Quit: C Enter F for Fudge, C for Carmel, P for Peanuts, B for Brownie, W for Whipped Cream or Q for Quit: P Enter F for Fudge, C for Carmel, P for Peanuts, B for Brownie, W for Whipped Cream or Q for Quit: B Enter F for Fudge, C for Carmel, P for Peanuts, B for Brownie, W for Whipped Cream or Q for Quit: Q Topping Cost: 3.75 Total Cost: 8.75

Please note you need to solve this program using loops and IF structures. A failure to do so will result in a severe deduction of points. Please read the rubric prior to submitting your program to make sure you included all necessary elements.

Once you have written, tested and debugged your Python program, attach the .py file to this question.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions