Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

A supermarket awards coupons 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)

import java.util.Scanner;

/**

* Code for E5.25

* @author

*/

public class GroceryDiscount

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

System.out.print("Please enter the cost of your groceries: ");

double bill = in.nextDouble();

double coupon = 0;

// Your work goes here

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93126504

Have any Question?


Related Questions in Computer Engineering

Number of cars average trvel time between a and b using

Number of cars Average trvel time between A and B using route 1 1 10 2 10 3 10 4 11 5 12 6 14 7 18 8 24 Alternative route 2: average travel time is 18 minutes(no matter how many cars are using it) How many cars will take ...

In c languageread a integer number which has 2 digits after

In C language: Read a integer number which has 2 digits after the decimal point. The number also has at least 6 digits the decimal point. Extract all digits at even positions from before the decimal point. Print them in ...

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What are the differences between the federal deficit and

What are the differences between the Federal deficit and Federal Debt? How does a government budget deficit affect the economy, specifically the unemployment rate and job creation? Identify two periods in recent history ...

Question suppose we perform n makeset operations followed

Question : Suppose we perform n MAKESET operations followed by m > n Find and/or Union operations? What is the worst case total amount of time spent using union by rank with path compression?

Suppose a firm is employing all its inputs so that the mrp

Suppose a firm is employing all its inputs so that the MRP per dollar spent on each sentence is the same. this suggest that: a) amount of each resource employed will depend on both its price and its productivity b) price ...

Question suppose we are interested in studying a dna

Question : Suppose we are interested in studying a DNA sequence which consists of four bases: A, C, G, and T. Write a program that does the following: Create a random DNA string of length 50. Determine how many times A o ...

What is the various security architectures which provides

What is the various security architectures. Which provides the best balance between simplicity and security? Justify your answer.

Once considered pure science fiction artificial

Once considered pure science fiction, artificial intelligence (AI) is being relied on more and more in today's world. Artificial intelligence deals with algorithms based on complex data sets. If you had to tell story rep ...

What is 4g and its benefits how fast is your internet

What is 4G and its benefits. How fast is your Internet service supposed to be for stationary users?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As