At a certain store they sell blank CDs with the following discounts:
* 10% for 120 or more
* 5% for 50 or more
* 1% for 15 or more
* no discount for 14 or less

Write a program that asks for several discs bought and outputs the correct discount. Use if..else if.. ladder statements. Assume that each blank disk costs N$3.50. The program should then calculate the total amount paid by the buyer for the discs bought.                      
..​

Respuesta :

A program exists as a detailed set of ordered operations for a computer to execute. Generally, the program exists placed into a storage area available to the computer.

What is a computer program?

In computing, a program exists as a detailed set of ordered operations for a computer to execute. In the modern computer that John von Neumann sketched in 1945, the program has a one-at-a-time series of instructions that the computer pursues. Generally, the program exists placed into a storage area available to the computer.

The program is as follows:

public static void main(String[] args)

{

int cdCount;

double cdCountAfterDiscount;

DecimalFormat df = new DecimalFormat("$##.##"); // Create a Decimal Formatter for price after discount

System.out.println("Enter the amount of CD's bought");

Scanner cdInput = new Scanner(System.in); // Create a Scanner object

cdCount = Integer.parseInt(cdInput.nextLine()); // Read user input

System.out.println("CD Count is: " + cdCount); // Output user input

if(cdCount <= 14 )

{

System.out.println("There is no discount");

System.out.println("The final price is " + cdCount*3.5);

}

if(cdCount >= 15 && cdCount<=50)

{

System.out.println("You have a 1% discount.");

cdCountAfterDiscount = (cdCount *3.5)-(3.5*.01);

System.out.println("The final price is " + df.format(cdCountAfterDiscount));

}

if(cdCount >= 51 && cdCount<120)

{

System.out.println("You have a 5% discount.");

cdCountAfterDiscount = (cdCount *3.5)-(3.5*.05);

System.out.println("The final price is " + df.format(cdCountAfterDiscount));

}

if(cdCount >= 120)

{

System.out.println("You have a 10% discount.");

cdCountAfterDiscount = (cdCount *3.5)-(3.5*.1);

System.out.println("The final price is " + df.format(cdCountAfterDiscount));

}

}

To learn more about computer programs refer to:

https://brainly.com/question/23275071

#SPJ9