import java.util.Scanner; /** * Asks the user for the meal price and desired tip percentage * and computes the tip for the meal * * @author alchambers * @version 2015 */ public class TipCalculator{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter the price of the meal:"); double price = input.nextDouble(); System.out.println("\nEnter the percent you want to tip (e.g. .20 or .15):"); double percent = input.nextDouble(); double tip = price * percent; System.out.println("\n\n====================="); System.out.println("Tip amount: " + tip); System.out.println("Total cost: " + (price + tip)); System.out.println("====================="); } }