Saved Bookmarks
| 1. |
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. |
|
Answer» 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 |
|