日期:2014-05-20 浏览次数:20768 次
import java.io.IOException; import java.util.Scanner; public class SlaryCalculate { public static void main(String args[]) throws IOException{ Scanner sr = new Scanner(System.in); System.out.println("请输入星期几(from 1 to 7):"); int week = sr.nextInt(); System.out.println("请输入工作小时数(from 0 to 24):"); int hour = sr.nextInt(); double salary = 0; double taxes = 0; salary=hour*25.5; if(week>=6&&week<=7) salary=salary*3; taxes=salary*0.045; System.out.println("日薪:" + salary + "元 税金:" + taxes+"元"); } }