Question: Discount Store Calculator Objectives Designing a program with selection structures NOTE: you will be uploading this file through this Canvas page. Do not post this

Discount Store Calculator

Objectives

Designing a program with selection structures

NOTE: you will be uploading this file through this Canvas page. Do not post this to your website.

The Discount Store offers discounts when you purchase multiple items of any item. Here is their discount schedule:

Number of Items

Discount Rate

0 - 5

0%

6 - 20

10%

21 - 50

15%

51 - 100

20%

over 100

25%

User Interface Specifications

The user must input the normal cost of the item, and the # of items purchased.

As output, the program should redisplay the user input and then the discount rate, the original cost, the amount saved, and the total discounted cost. See Sample Run at bottom of page.

Your output should look the same as the sample output below:

use of bold and underline

numbers formatted to 2 decimal places

use of blank lines

units

(2 BONUS POINTS) If the user enters a number of items less than zero, or an item price less than zero, the program should display a message saying so. It should NOT calculate and display any information for this situation. It is typical to test for this invalid input condition as the first test in a series of tests.

Documentation and Other Style Issues

Use descriptive variable names.

Make sure your code is organized. Input, calculations, and output sections should be distinct

Your html must be correct, as we've learned. Include your name in an html comment at the top of the file.

Sample Run

Imagine that there is an item that usually costs $3.50 and the customer wants to purchase 15 of them. Here is how the program works:

Discount Store Calculator Objectives Designing a program with selection structures NOTE: you

will be uploading this file through this Canvas page. Do not post

After the program performs its decisions and calculations, it display all inputs and results:

this to your website. The Discount Store offers discounts when you purchase

) file:///Volumes/k X NSCCsC111 websites programmer jokes Discount Store Calculator + The Discount Store Calculator Enter the number of items: 15 Cancel OK

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!