title: Calculating State And Sales Tax
body: <p>A program that will ask the user to enter the amount of a purchase. The program should then compute the state sales tax and county sales tax. Assume the state sales tax is 4% and the county sales tax is 2%. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total tax, and total cost of the purchase.</p>
  
  <p>id like to know if i did this correctly or does it need some changes.</p>
  
  <pre><code>public static void main(String[] args) {
  double Purchaseamount= 30; 
  double Statetax = 4.00;
  double Countytax = 2.00;
  double sum, totalcost;  
  
      //Calculate total tax
      Statetax=(Statetax/100.0);
      Countytax=(Countytax/100.0); 
      sum = Statetax + Countytax;
      totalcost = Purchaseamount + sum; 
  
      //Display the following output
      System.out.print("Enter the Purchase amount ");
      System.out.println(Purchaseamount);
      System.out.print("Purchase amount: $");
      System.out.println(Purchaseamount);
      System.out.print("State tax: $");
      System.out.println(Statetax);
      System.out.print("County tax: $");
      System.out.println(Countytax);
      System.out.print("Total tax: $");
      System.out.println(sum);
      System.out.print("Total coast: $");
      System.out.println(totalcost); 
  }
  </code></pre>