// CSE 142, Autumn 2009, Marty Stepp // This program uses variables to compute the bill at a restaurant. public class Receipt { public static void main(String[] args) { int subtotal = 38 + 40 + 30; System.out.println("Subtotal: " + subtotal); // Calculate total owed, assuming 8% tax / 15% tip double tax = subtotal * .08; System.out.println("Tax:" + tax); double tip = subtotal * .15; System.out.println("Tip:" + tip); double total = subtotal + tax + tip; System.out.println("Total: " + total); } }