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

  1. Get tax rate:

    • Input tax rate.

  2. Get cost of item:
    • Input item cost.
  3. Calculate the tax by multiplying the tax rate by the cost of the item.
    • Tax = Item Cost * Tax Rate
  4. Calculate the total cost by adding the tax to the cost of the item.
    • Total Cost = Item Cost + Tax
  5. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!