Ask Question
21 December, 23:12

in java A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county sales tax collected. The state sales tax rate is 4 percent and the county sales tax rate is 2 percent. Write a program that asks the user to enter the total sales for the month. The application should calculate and display the following: • The amount of county sales tax • The amount of state sales tax • The total sales tax (county plus state)

+5
Answers (1)
  1. 21 December, 23:31
    0
    import java. util. Scanner; public class Main { public static void main (String[] args) { Scanner input = new Scanner (System. in); System. out. print ("Input total sales of month: "); double totalSales = input. nextDouble (); double stateTax = totalSales * 0.04; double countyTax = totalSales * 0.02; double totalSalesTax = stateTax + countyTax; System. out. println ("County Tax: $" + countyTax); System. out. println ("State Tax: $" + stateTax); System. out. println ("Total Sales Tax: $" + totalSalesTax); } }

    Explanation:

    Firstly, create a Scanner object and prompt user to input total sales of month (Line 5-7). Next, apply the appropriate tax rate to calculate the state tax, county tax (Line 9 - 10). Total up the state tax and county tax to get the total sales tax (Line 11).

    At last, print the county tax, state tax and the total sales tax (Line 13 - 15).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “in java A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county ...” 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