Question: Write a program using for - loops that calculates and prints the discount and the final price for an item at a store for different

Write a program using for-loops that calculates and prints the discount and the final price for an item at a store for different discount rates. Specifically, write a program that
Asks the user for the price of the item.
Validates that the input is positive.
Using a for-loop calculates the discount amount and prints the discounted price for the discount percent rates in this sequence: 32%,28%,24%,20%,16%,12%,8%,4% and 0%. Make sure the prices are printed rounded to 2 decimal places. (You have to use a for-loop to avoid code duplication. You will lose points otherwise).
Prints Goodbye!

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!