Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

image text in transcribed

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

image text in transcribed

) 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

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions