A shopkeeper offers 20% discount on the printed price of a digital camera.
However, a customer has to pay 18% GST on the remaining amount. Write a
program in java to calculate the amount to be paid by the customer. Assign
the printed price of the camera.
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class KboatCameraPrice
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.println("Enter printed price of Digital Camera:");
double mrp = in.nextDouble();
double disc = mrp * 20 / 100.0;
double price = mrp - disc;
double gst = price * 18 / 100.0;
price += gst;
System.out.println("Amount to be paid: " + price);
}
Explanation:
Hope it is helpful for you
Similar questions