Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Project2_BaileyHollingsworth {
- public static void main(String[] args){
- //Bailey Hollingsworth
- final float bookDesignPatterns = 32.46f; //Price of each book type.
- int numberOfDesignPatterns = 2; //Amount of that book purchased
- final float bookEffectiveJava = 35.48f;
- int numberOfEffectiveJava = 3;
- final float bookJavaPuzzlers = 27.86f;
- int numberOfJavaPuzzlers = 1;
- float preTaxCost = (bookDesignPatterns * numberOfDesignPatterns) + //Sums up the raw cost of the purchase
- (bookEffectiveJava * numberOfEffectiveJava) + (bookJavaPuzzlers * numberOfJavaPuzzlers);
- final double salesTax = preTaxCost * 0.065;; //Represents 6.5% tax rate in calculation
- double totalCost = (preTaxCost + salesTax); //Adds the sales tax to the raw amount for a final cost
- System.out.println("Your purchase total is: $" + preTaxCost);
- System.out.println("Sales tax is: $" + salesTax);
- System.out.println("The total cost today will be: $" + totalCost);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement