Computer Science, asked by anshuhero8, 1 month ago

10. Mega Market has announced festival discounts on the
purchase of items, based on the total coast of the items
purchased:
Total cost
Up to 72,000
72,ool to 75,000
25,001 to loooo
Above & 19ooo
Discount
5 %
10%.
15%
20%
Write a program to input the total cost. Display name of
the customer discount and the amount to be paid after discount.​

Answers

Answered by meghanasharma842
1

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: " + amt);

}

}

OUTPUT

Similar questions