?? newsalary.java
字號:
package myCompany;
import myCompany.*;
public class newSalary extends Tools implements salaryInfo
{
protected String workno;//員工編號
protected double bsalary,allowance,bonus,ssalary,linsurance;
//依次是:基本工資,津貼、獎金,應(yīng)發(fā)工資,養(yǎng)老保險
protected double hfound,tax,rsalary; //依次是:住房公積金,所得稅,實發(fā)工資
newSalary()//構(gòu)造函數(shù)1
{
workno = "";
bsalary = 0;
allowance = 0;
bonus = 0;
calssalary();
calLinsurance();
calhfound();
}
newSalary(String in1,double in2,double in3, double in4)//構(gòu)造函數(shù)2
{
workno = in1;
bsalary = in2;
allowance = in3;
bonus = in4;
calssalary();
calLinsurance();
calhfound();
}
public void calssalary()//計算應(yīng)發(fā)工資
{
ssalary = bsalary + allowance + bonus;
}
public void calLinsurance()//計算養(yǎng)老保險
{
linsurance = ssalary * 0.08;
}
public void calhfound()//計算住房公積金
{
hfound = ssalary * 0.07;
}
public double getTax()//獲得應(yīng)交稅金
{
tax = super.getTax(ssalary);
return tax;
}
public double getssalary()//獲得應(yīng)發(fā)工資
{
return ssalary;
}
public double getrsalary()//獲得實發(fā)
{
rsalary = ssalary + hfound + linsurance - tax;
return rsalary;
}
public static void main(String args[])
{
newSalary sa = new newSalary(args[0],Double.parseDouble(args[1]),
Double.parseDouble(args[2]),Double.parseDouble(args[3]));
System.out.println("職工號:"+sa.workno);
System.out.println("基本工資: "+sa.bsalary);
System.out.println("津貼: "+sa.allowance);
System.out.println("獎金: "+sa.bonus);
System.out.println("養(yǎng)老保險: "+sa.linsurance);
System.out.println("住房公積金: "+sa.hfound);
System.out.println("扣稅: "+sa.getTax());
System.out.println("應(yīng)發(fā)工資: "+sa.getssalary());
System.out.println("實發(fā)工資: "+sa.getrsalary());
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -