how to write cloth showroom program in java
Answers
Answer:
import java.util.Scanner;
public class KboatClothDiscount
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter total cost: ");
double cost = in.nextDouble();
double amt;
if (cost < 2000) {
amt = cost - (cost * 5 / 100.0);
}
else if (cost < 5000) {
amt = cost - (cost * 25 / 100.0);
}
else if (cost < 10000) {
amt = cost - (cost * 35 / 100.0);
}
else {
amt = cost - (cost * 50 / 100.0);
}
System.out.println("Amount to be paid: " +OUTPUT
BlueJ output of A cloth showroom has announced the following festival discounts on the purchase of items based on the total cost of the items purchased: Write a program to input the total cost and to compute and display the amount to be paid by the customer availing the the discount. amt);