Question
In Java Coding ! Sales Tax Using the refined algorithm from the second lecture on problem solving methods, write the code to compute the sales
In Java Coding !
Sales Tax
Using the refined algorithm from the second lecture on problem solving methods, write the code to compute the sales tax of an item. Include the following:
1. Format the output for currency. 2. Format any non-currency output with two decimal places. NOTE: 1. Declare all variables within the data declaration section. 2 Do not get input on the same line as a variable declaration. 3. Do not place an equation for computation on the same line as declaring a variable.
Submit the java file.
-------------------------------------------------
The Refined Algorithm to use
-
Get tax rate:
-
Input tax rate.
-
- Get cost of item:
- Input item cost.
- Calculate the tax by multiplying the tax rate by the cost of the item.
- Tax = Item Cost * Tax Rate
- Calculate the total cost by adding the tax to the cost of the item.
- Total Cost = Item Cost + Tax
- Display the cost of the item, the tax, and the total cost.
- Output the cost of the item, the tax, and the total cost.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started