Question: 1 . Financial application: calculate tip Write a program named LastNameTip that reads the subtotal and the gratuity rate and then computes the gratuity and

1. Financial application: calculate tip
Write a program named LastNameTip that reads the subtotal and the gratuity rate and
then computes the gratuity and total. For example, if the user enters 10 for the subtotal, and 15% for the gratuity rate, the program displays $1.50 as gratuity and 11.50 as total. The program should let the user know if they have entered a subtotal or a gratuity rate that is negative and if so, the program should end without doing any math.
Here is a sample run; the bold represents the input from the user:
Enter the subtotal: 10
Gratuity rate in %: 15
The Gratuity is $1.50 and the total is $11.50

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 Programming Questions!