public void IncreaseBasicPay() { foreach (Employee emp in employeeList) { if (emp is FullTimeEmployee) { FullTimeEmployee e = (FullTimeEmployee)emp; e.BasicPay *= 1.1; } } }
List <Employee> employeeList = new List <Employee>(); // outside of MainPage() to allow other methods to access (qns 7) public MainPage() { this.InitializeComponent(); // Question 7 Employee employee1 = new FullTimeEmployee(103, "John", 1500.0, 100.0); Employee employee2 = new PartTimeEmployee(101, "Mary", 50.0, 10); Employee employee3 = new SalesEmployee(102, "Apple", 1000.0, 50.0, 10000.0); employeeList.Add(employee1); employeeList.Add(employee2); employeeList.Add(employee3); }