3. A shopkeeper offers 10% discount on the printed price of a Digital Camera.However, a customer has to pay 6% GST on the remaining amount. Write aprogram in Java to calculate the amount to be paid by the customer takingprinted price as an input.
Answers
Answered by
11
import java.io.*;
class abc
{
public static void main(String args[])throws IOException
{
InputStreamReader reader=new InputStreamReader(System.in);
BufferedReader input=new BufferedReader(reader);
double amt,dis_percent,gst,gst_paid,amt_paid;
System.out.println("ENTER THE PRINTED PRICE");
amt=Double.parseDouble(input.readLine());
dis_percent=10
dis=(dis_percent/100)*amt;
gst=6;
gst_paid=(gst/100)*(amt-dis);
amt_paid=amt-dis+gst_paid;
System.out.println("Amount to be paid by customer="+amt_paid);
} //end of main
} //end of class
Similar questions