draw a flowchart of the given problem, and then convert that flowchart into Java code. A supermarket awards coupon depending on how much a customer spends on groceries. For example, if you spend $50, you will get a coupon worth eight percent of that amount. The following table shows the percent used to calculate the coupon awarded for different amounts spent. Write a program that calculates and prints the value of the coupon a person can receive based on groceries purchased. Here is a sample run: Please enter the cost of your groceries: 14 You win a discount coupon of $ 1.12. (8% of your purchase) Money Spent Coupon Percentage Less than $10 No coupon From $10 to $60 8% More than $60 to $150 10% More than $150 to $210 12% More than $210 14%
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
In this task, you are being asked to draw a flowchart of the given problem, and then convert that
flowchart into Java code.
A supermarket awards coupon depending on how much a customer spends on groceries. For
example, if you spend $50, you will get a coupon worth eight percent of that amount. The following
table shows the percent used to calculate the coupon awarded for different amounts spent. Write a
program that calculates and prints the value of the coupon a person can receive based on groceries
purchased.
Here is a sample run:
Please enter the cost of your groceries: 14
You win a discount coupon of $ 1.12. (8% of your purchase)
Money Spent Coupon Percentage
Less than $10 No coupon
From $10 to $60 8%
More than $60 to $150 10%
More than $150 to $210 12%
More than $210 14%
NOTE : using java
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images