public class Demo8 { int id; String name; int money; String bumen; public void Department(){ System.out.print("部门信息\t部门编号:"+id+","+"部门名称:"+name); } } public class Demo9 { int id; String name; double money; String bumen; public void Employee(){ System.out.print("\n员工信息\t员工编号:"+id+","+"姓名:"+name+","+"底薪"+money+","+"所在部门:"+bumen); } public double show(){ System.out.println("\n请输入"+name+"本月销售额:"); Scanner input = new Scanner(System.in); int m1 = input.nextInt(); if(m1<100000){ money=money+m1*0.01; }else if(m1>=100000&&m1<200000){ money=money+m1*0.02; }else if(m1>=200000){ money=money+m1*0.03; } return money; } } public class Text { public static void main(String[] args) { Demo8 s = new Demo8(); s.id=0001; s.name="销售部"; s.Department(); Demo9 l = new Demo9(); l.id=0033; l.name="郭德纲"; l.money=2000; l.bumen="销售部"; l.Employee(); l.show(); double f=l.money; System.out.println(l.name+"本月的工资为"+f+"元"); } }
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。