标签:
1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the subtotal and a gratuity rate: "); 10 11 double subtotal = input.nextDouble(); 12 double gratuityRate = input.nextDouble(); 13 14 double gratuity = subtotal * gratuityRate / 100.0; 15 double total = subtotal + gratuity; 16 17 System.out.println("The gratuity is " + gratuity + " and total is " + total); 18 19 input.close(); 20 } 21 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5743844.html