public static void practice16() { FullTimeEmployee fe = new FullTimeEmployee("Tom", 190021); fe.AnnualSalary = 10000; fe.AdjustSalary(-100); Console.WriteLine("{0}'s annual salary is {1}", fe.Name, fe.AnnualSalary); fe.SayName(); PartTimeEmployee pe = new PartTimeEmployee("Jane"); pe.hourlyRate = 100; int workHour = 8; int totalPayment = pe.CalculatePay(workHour); Console.WriteLine("{0}'s work hour is {1}, total payment is {2}", pe.Name, workHour, totalPayment); pe.SayName(); }
public static void practice15() // ppt practice#16 employee class 상속 { FullTimeEmployee park = new FullTimeEmployee("park", 1234); park.AnnualSalary = 10000; park.AdjustSalary(100); Console.WriteLine("{0}'s annual salary is {1}", park.Name, park.AnnualSalary); park.SayName(); PartTimeEmployee choi = new PartTimeEmployee("choi"); choi.TimelySalary = 100; int workHour = 8; int totalPayment = choi.CalculatePay(workHour); Console.WriteLine("{0}'s work hour is {1}, total payment is {2}", choi.Name, workHour, totalPayment); choi.SayName(); }