Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads the subtotal and the gratuity rate,and computes the g

ID: 3608734 • Letter: W

Question

Write a program that reads the subtotal and the gratuity rate,and computes the gratuity and total. For example, if the userenters 10 for subtotal and 15% gratuity rate, the program displays$1.5 as gratuity and $11.5 as total.
I need a very detailed response for this one Write a program that reads the subtotal and the gratuity rate,and computes the gratuity and total. For example, if the userenters 10 for subtotal and 15% gratuity rate, the program displays$1.5 as gratuity and $11.5 as total.
I need a very detailed response for this one

Explanation / Answer

importjava.util.Scanner;
public class gratuity
{
public static void main(String []args)
{
double subtotal,total,rate,tax;
Scanner keyboard = new Scanner(System.in);
System.out.print("What is your subtotal ");
subtotal = keyboard.nextDouble();
System.out.print("What is the gratuity rate ");
rate = keyboard.nextDouble();
tax=rate/100.*subtotal;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote