liang183 发表于 2016-12-24 15:09:07

java编程题目财务应用小程序:计算小费

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 anda 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);    }}
页: [1]
查看完整版本: java编程题目财务应用小程序:计算小费