Write a program that reads how much a customer spends on groceries and computes the discount coupon that a customer will be awarded. The following table shows the percent used to calculate the coupon awarded for different amounts spent. Your program should calculate and print the value of the coupon a person can receive based on groceries purchased. The program should display the message “Error: negative cost" if user enters a negative groceries cost. Money Spent Less than $10 Coupon Percentage No coupon From $10 to $60 More than $60 to $150 8% 10% More than $150 to $210 12% More than $210 14% Please enter the cost of your groceries: 14 You won a discount coupon of $ 1.12. (8% of your purchase)
Write a program that reads how much a customer spends on groceries and computes the discount coupon that a customer will be awarded. The following table shows the percent used to calculate the coupon awarded for different amounts spent. Your program should calculate and print the value of the coupon a person can receive based on groceries purchased. The program should display the message “Error: negative cost" if user enters a negative groceries cost. Money Spent Less than $10 Coupon Percentage No coupon From $10 to $60 More than $60 to $150 8% 10% More than $150 to $210 12% More than $210 14% Please enter the cost of your groceries: 14 You won a discount coupon of $ 1.12. (8% of your purchase)
Chapter2: Using Data
Section: Chapter Questions
Problem 11PE
Related questions
Question
Write a problem, input, output, algorithm ,comments and design a program
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 7 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT