Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started