Calculate discount on the basis of sales
01/01/2002 08:22
public class calculatingdiscountsonsales
{
public static void main(String args[])
{
int sales=2000;
double discount=0;
if(sales>15000)
{
discount=0.3;
double prize=sales*discount;
System.out.println(prize);
System.out.println("discount is 30 percent");
}
if(sales>10000&&sales<15000)
{
discount=0.2;
double prize=sales*discount;
System.out.println(prize);
System.out.println("discount is 20 percent");
}
if(sales>1000&&sales<10000)
{
discount=0.1;
double prize=sales*discount;
System.out.println(prize);
System.out.println("discount is 10 percent");
}
}
}