// A program to calculate the total due from a coffee order. // Includes 10% tax and a 5% "preferred customer" discount. // // This version has introduced variables to improve the // readability of the program. public class CoffeeOrder2 { public static void main(String[] args) { // latte ($5), frappuccino ($6), drip coffee ($2) int latte = 5; int frap = 6; int drip = 2; int subtotal = latte + frap + drip; double tax = subtotal * 0.1; double discount = subtotal * 0.05; double total = subtotal + tax - discount; System.out.println("Subtotal: $" + subtotal); System.out.println("Tax: $" + tax); System.out.println("Discount: ($" + discount + ")"); System.out.println("TOTAL: $" + total); } }