| 1. |
How to write cloth showroom program in java |
|
Answer» 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); |
|