7.6 Ch 2. Sales Tax Calculator (Java) Purpose: This application will compute the
ID: 3915456 • Letter: 7
Question
7.6 Ch 2. Sales Tax Calculator (Java)
Purpose: This application will compute the tax and final cost of a purchased item.
Program Procedures: You will create the program using the item input as paper and the cost as $12.95.
Algorithms, Processing and Conditions:
Your output will consist of four lines. The first will have the item (paper) being purchased, the second will show the price for the item, the third will show the amount of tax calculated at 8.75% of the item's cost (show all decimal places) and finally fourth, the total cost of the item plus tax (show all decimal places.)
Enter your data as the item name on the first line, then press the enter key, and on the second line enter the amount.
Explanation / Answer
import java.util.Scanner; public class PaperTax { public static void main(String[] args) { Scanner in = new Scanner(System.in); String itemName = in.nextLine(); double price = in.nextDouble(); System.out.println(itemName); System.out.println(price); System.out.println(price*0.0875); System.out.println(price*1.0875); } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.