Ask Question
28 June, 10:21

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)

+2
Answers (1)
  1. 28 June, 13:26
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers