Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A fashion company has developed a new product due to the demand associated with the COVID pandemic: facemasks. Each mask sells for $13. Quantity discounts

image text in transcribed

A fashion company has developed a new product due to the demand associated with the COVID pandemic: facemasks. Each mask sells for $13. Quantity discounts are given according to the following table. Quantity Discount 10 - 49 20% 50 - 199 30% 200- 499 40% 500 or more 50% Write a program that asks for the number of facemasks ordered online and computes the total cost of the purchase. Also, show the customer how much was saved with the discount Format the output for currency (two decimal places). Avoid the use of exit(0). I expect to see the generous use of constants. Input Validation: Make sure the number ordered is greater than zero and less than or equal to 10,000. You may assume the user inputs an integer. End the program with a user-friendly message if the input is invalid. (We'll learn about more robust input validation later.)

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 Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

What is accounting?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago