Question: Write a Java program that implements a tip calculator. The program should ask for the cost of a meal and then calculate the tip amount

Write a Java program that implements a tip calculator. The program should ask for the cost of a meal and then calculate the tip amount for 10%, 15% 20%, and 25% tips. The program MUST contain two loops. The program will use the outer loop to continue to ask for the cost of a meal until the user enters a negative number as a sentinel value. The inner loop will handle the four tip percentages.

Start the program as follows:

import java.util.Scanner; public class Main { private static Scanner input = new Scanner (System.in); public static void main(String[] args) { double mealCost, tip; int tipPct;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!