Question: Build a python program in vs code (or other python editor) that does the following: Asks the user for the number of cycles to run

Build a python program in vs code (or other python editor) that does the following:

Asks the user for the number of cycles to run

Loops through the number of cyles and asks user for an item description and matching value

Asks the user if there is some kind of value reduction (coupon, discount, etc)

if there is a reduction, reduce the value of the item by the amount of the reduction (or set to zero if the coupon exceeds the cost of the item)

output the item and its value

Total the values of the items and outputs that total price

Examples of this sort of thing would be groceries, you could have milk, bread, cereal, and coupons for one or several of those items. Another example would be computer parts. Feel free to explore it a little bit, but you should build

1 loop (minimum) 1 condition (minimum) User input data output

And then replace the question about number of cycles with an automatic run of the item description/value/reduction process. After one has run, check if the user has another item to enter and continue or quit based on their answer.

Add a condition to the end which outputs total savings, if coupons/discounts have been applied, and the value is greater than zero. When true, output total savings the user received for the items.

Your program will have

1 loop with a post run check

1 simple condition

1 compound condition

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!