84 424
Assignments Done
98,8%
Successfully Done
In March 2020

# Answer to Question #16629 in Java | JSP | JSF for Ijan

Question #16629
Write a program that calculates the Total Price of value meal ordered. The Total Price must include the 8% Government tax. Get inputs from user, the type of value meal selected and the quantity ordered. Use if-else statement. Hints Gov tax = 0.08 x Price and Total Price = (Price x quantity) + Government Tax
1
2012-10-17T09:40:32-0400
import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

double TAX = 0.08;

System.out.println(&quot;Enter the price of a meal: &quot;);

String price = in.nextLine();

System.out.println(&quot;Enter the quantity: &quot;);

String quantity = in.nextLine();

double govTax = Double.parseDouble(price) * TAX;

double totalPrice = (Double.parseDouble(price) * Double.parseDouble(quantity)) +
govTax;

System.out.println(&quot;Total price: &quot; + totalPrice);

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Assignment Expert
18.10.12, 14:27

If you really liked our service please press like-button beside answer field. Thank you!

Ijan
17.10.12, 20:22

Hi, thank you so much admin...