// X119SalesTax8.java // Andrew Hoffmann

import javax.swing.JOptionPane;

public class X119SalesTax8
{
	public static void main(String[] args)
		{
		String purchase;
		double stax, ctax, amount, ttax, total;

        //Purchase input
	    purchase = JOptionPane.showInputDialog("What is the amount of purchase?");
	    //Convert string to double
	    amount = Double.parseDouble(purchase);
	    //State tax
	    stax = 0.04 * amount;
	    //County tax
	    ctax = 0.02 * amount;
	    //Total tax
	    ttax = stax + ctax;
	    //Total price w/ tax
	    total = ttax + amount;
	    // Outputs
	    System.out.println("The amount of the item is $" + amount);
	    System.out.println("The State Tax is $" + stax);
	    System.out.println("The County Tax is $" + ctax);
	    System.out.println("The total amount of tax is $" + ttax);
	    System.out.println("The total amount is $" + total);
		}
}
