package nameyu;import java.util.Scanner; public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner (System.in); System.out.print("Enter the subtotal and a gratuity rate:"); double subtotal=input.nextDouble(); double gratuityrate=input.nextDouble(); double gratuity=subtotal*gratuityrate*0.01; double total=subtotal+gratuity; System.out.println("The gratuity is $"+gratuity+" and total is $"+total); } }
|