1 import java.util.Scanner; 2 public class Rate { 3 public static void main(String[] args){ 4 Scanner input = new Scanner(System.in); 5 System.out.println("Enter the subtotal and a gratuity rate:"); 6 double sub = input.nextDouble(); 7 double rate = input.nextDouble(); 8 double gra = sub*rate*0.01; 9 double total = gra+sub; 10 System.out.println("The gratuity is $" + gra + " and total is $" + total); 11 } 12 }