package project_02;
import java.util.Scanner;
/**快捷鍵:shift+Alt+j
*
* 2018-9-7 18:44:47
*@author Sauron XiaMen
*/
public class Salary {
//輸入基本工資3000
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.print("請輸入基本工資:");
double salary=input.nextDouble();
double prices=salary*0.4; //物價津貼
double rent=salary*0.25; //房租津貼
//輸出結果
System.out.println("該員工的工資細目為:");
System.out.println("基本工資為:"+salary);
System.out.println("物價津貼為:"+prices);
System.out.println("房租津貼為:"+rent);
System.out.println("員工薪水是:"+(salary+prices+rent));
input.close(); //關閉Scanner
}
}
結果如下:
