Question: Write a program that prompts the user for the name of an item that they intend to buy, the cost of the item, and the

Write a program that prompts the user for the name of an item that they intend to buy, the cost of the item, and the quantity they wish to purchase. Based on this information, display the total cost of the purchase.
Notes:
Quantities may only be expressed as whole numbers
Orders of more than 12 items and orders totaling more than $100 qualify for a 10% discount
You are not responsible for checking for invalid quantities or prices (ex: negative values)
Display a single item using the name entered. Display multiples of an item by adding an s to the name entered, even if it is grammatically incorrect.
Enter item name: Microwave Ramen Cooker
Enter price for one Microwave Ramen Cooker: 3.99
Enter quantity desired: 2
An order of 2 Microwave Ramen Cookers will cost a total of $7.98
Enter item name: Vegan Messenger Bag
Enter price for one Vegan Messenger Bag: 219
Enter quantity desired: 1
An order of 1 Vegan Messenger Bag will cost a total of $197.10
Note: Price reflects a 10% discount.
We ask that you do the input and output in the "main" area and that you define a function called calculateTotalPrice(...) which receives the price of the item and the quantity desired and returns a number representing the total price, including any applicable discount.
Remember that you can use multiple print() statements to print to the same line by adding , end="" to the print statement.

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!