Ask Question

Write out an algorithm where you know the cost of an item, the state tax rate on it; the federal tax rate on it; and the money a customer gives you. Write out steps and formulas it takes to solve You will calculate and output to the customer the change you will to give them.

+3
Answers (1)
  1. 15 October, 21:36
    0
    Algorithm:

    1. Declare variables "cost","state_tax" and "federal_tax".

    2. Initialize these variables.

    3. Create a variable "cust_money".

    3.1 Ask user to give money.

    3.2 Assign this to "cust_money".

    4. Calculate total_tax=state_tax+federal_tax

    4.1 Calculate total_to_be_paid=cost (1+total_tax)

    5. Calculate change_to_give = cust_money-total_to_be_paid

    6. Print the change_to_give

    7. End the program.

    Explanation:

    Declare variables and initialize "cost" with initial cost of item, "state_tax" with state tax and "federal_tax" with federal tax on the item. Ask user to give money and assign it to "cust_money". calculate the total tax=state+federal tax. Then calculate the total to be paid for item as cost * (1+total tax). Subtract the total paid from customer money and print the change to give user.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write out an algorithm where you know the cost of an item, the state tax rate on it; the federal tax rate on it; and the money a customer ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers