Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.50 as gratuity and $11.50 as total. Here is a sample run:
Breaking it down
First, the program will asking the user to enter subtotal and gratuity while storing the values in two local variables gratuityTotal and gratuityRate. Next a method gratuity will calculate the gratuity for the bill and total will add the subtotal and gratuity total together. Finally a message will be outputted to the users.