Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

b. Will there be one assigned leader?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago