Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- double mealCharge;
- double taxAmount;
- double tipAmount;
- double totalBill;
- System.out.println("Enter the charge of the meal");
- mealCharge = keyboard.nextDouble();
- taxAmount = mealCharge * 0.0675;
- tipAmount = mealCharge * 0.20;
- totalBill = mealCharge + taxAmount + tipAmount;
- System.out.println("Meal charge: " + mealCharge);
- System.out.println("Tax amount: " + taxAmount);
- System.out.println("Tip amount: " + tipAmount);
- System.out.println("Total bill: " + totalBill);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment