public class test {
String tname;
int tage;
int tsalary;
public void setname(String myname){
this.tname=myname;
}
public void setage(int myage){
this.tage=myage;
}
public void setsalary(int mysalary){
this.tsalary=mysalary;
}
public int getsalary(){
return this.tsalary;
}
public static void main(String[] args) {
int temp;
test mytest=new test();
mytest.setname("王刚");
mytest.setage(29);
mytest.setsalary(10000);
temp=mytest.getsalary();
if(temp>=10000)
{
temp=(int)(temp*0.95);
mytest.setsalary(temp);
}
else if(temp<8000)
{
temp=(int)(temp*0.9);
mytest.setsalary(temp);
}
System.out.println(mytest.getsalary());
}
}