Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions