Computer Science, asked by himanshusinghkharwar, 4 months ago



Total cost
Less than 20,000
Rs 2000 to 40,000
RS 40,001 to 70000
Abone 70,000
discount
5%
7%
10%
12.5%
write a
a program do input the total cost of
the item and calculate and print the discount
amount and the total amount to be paid by the .
customer after the discount​

Answers

Answered by khushiagarwal27611
2

Answer:

import.java.util.*;

Class Cost

{

int t,dis,totalamt;

void input()

{

System.out.println("Enter the total cost of the item");

if (t<20000)

{

dis=0.05;

}

if(t>20000&&t<40000)

{

dis=0.07;

}

if(t>40000&&t<70000)

{

dis=0.10;

}

if(t>70000)

{

dis=1.25;

}

totalamt=t-dis;

System.out.println("Discount amount"+dis);

System.out.println("Total amount to be paid"+totalamt);

}

}

Similar questions