Hlo frnds good morning....... Plzz ansr this qstn fast it's urgent.....ansr fast.....
Attachments:
Answers
Answered by
3
Answer:
import java.util.*;
public class Price
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int price;
double d=0.0,amt=0.0;
System.out.println("Enter the price of product");
price=in.nextInt();
if(price>30000)
{
d=10.0/100.0*price;
amt=price-d;
}
else if(price>=15000&&price<=30000)
{
d=7.5/100.0*price;
amt=price-d;
}
else if(price<15000&&price>=5000)
{
d=5.5/100.0*price;
amt=price-d;
}
else if(price>0&&price<5000)
{
d=3.0/100.0*price;
amt=price-d;
}
System.out.println("The amount paid by customer="+amt);
}
}
Note:You wrote 50000 which is an invalid input as it is the first condition hence I think it should be 5000 not 50000 Ok hope it helps.........
Similar questions
English,
3 months ago
Computer Science,
3 months ago
English,
3 months ago
Math,
6 months ago
Math,
10 months ago
Computer Science,
10 months ago