Пример #1
0
 public override void Visit(FullTimeEmployee employee)
 {
     Console.WriteLine($"{employee.Name}工作时间为:{employee.Time}");
     if (employee.Time > 40)
     {
         Console.WriteLine($"{employee.Name}加班时间为:{employee.Time-40}");
     }
     else
     {
         Console.WriteLine($"{employee.Name}请假时间为:{40-employee.Time}");
     }
 }
Пример #2
0
        public override void Visit(FullTimeEmployee employee)
        {
            int    time = employee.Time;
            double wage = employee.Wage;

            if (wage > 40)
            {
                wage = wage + (time - 40) * 100;
            }
            else
            {
                wage = wage - (40 - time) * 80;
            }
            Console.WriteLine($"正式员工{employee.Name}工资:{wage*time}");
        }
Пример #3
0
 public abstract void Visit(FullTimeEmployee employee);