A departmental store offers the following discounts to it's members on purchase of certain items
Rs.0-Rs.1000 discount -5%
Rs.1001-Rs.2000 discount -7%
Rs.2001-Rs.5000 discount -10%
Above Rs.5000 discount-20%
GST will be calculated as 12% of the total bill (After calculating the discount)
Wap in java to input the membership number and the amount of purchase. Calculate the total amount to be paid.Display the customer membership number along with the amount to be paid.
PLS answer !!!!
Answers
Answered by
2
Answer:
import java.util.*;
class Departmental
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
int mn;
double a, d = 0.0, gsta = 0.0;
System.out.println("Enter the membership number");
mn = in.nextInt();
System.out.println("Enter the amount of purchase");
a = in.nextDouble();
if(a >= 0 && a <= 1000)
d = (1.0 - (5/ 100.0)) * a;
if(a >= 1001 && a <= 2000)
d = (1.0 - (7/ 100.0)) * a;
if(a >= 2001 && a <= 5000)
d = (1.0 - (10/ 100.0)) * a;
if(a > 5000)
d = (1.0 - (20/ 100.0)) * a;
gsta = (1.0 - (12/ 100.0)) * d;
System.out.println("Membership number = " + mn);
System.out.println("Amount to be paid = Rs." + gsta);
}
}
Similar questions