Posted by AB on Thursday, May 17, 2012 at 9:28pm.
I used NetBeans IDE 7.1.2 and this worked:
package purchaseamount;
import java.util.Scanner;
/**
*
* @author AB
*/
public class PurchaseAmount {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
double purchaseAmount;
double stateSalesTax = 0.04;
double countySalesTax = 0.02;
double totalSalesTax;
double totalSale;
Scanner keyboard = new Scanner(System.in);
System.out.print("What is the purchase amount? ");
purchaseAmount = keyboard.nextDouble();
stateSalesTax = stateSalesTax * purchaseAmount;
countySalesTax = countySalesTax * purchaseAmount;
totalSalesTax = stateSalesTax * countySalesTax;
totalSale = totalSalesTax + purchaseAmount;
System.out.println("Purchase " + purchaseAmount);
System.out.println("State Tax " + stateSalesTax);
System.out.println("County Tax " + countySalesTax);
System.out.println("Total Tax " + totalSalesTax);
System.out.println("Total Sale " + totalSale);
}
}
Related Questions
Computer Programming Design - Design a program that will ask the user to enter ...
Compter programing Design - Design a program that will ask the user to enter the...
Computer Programming Design - I really need someone to help me with this.I post ...
Computer class - how do I design a program using a flowchart, the program needs ...
CIS Design and Programming - Design a program that calculates the total amount ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for ...
Computer Programing & Logic Design - Submit pseudocode and a flowchart for ...
Programming - Design a program that calculates the total amount of a meal ...
Programming - Language - PYTHON Design a program that calculates the total ...
For Further Reading