using System.Collections.Generic;
using System.Threading.Tasks;
public Employee(string n, double s, int by)
public string getStatus()
if(status == true) return "Active";
return(DateTime.Now.Year - birthYear);
public void displayDetail()
Console.WriteLine("NAME : " + name);
Console.WriteLine("SALARY : $" + salary);
Console.WriteLine("STATUS : " + getStatus());
Console.WriteLine("AGE : " + getAge());
public class Officer : Employee
public Officer(string n, double s, double p, int by) : base(n, s, by)
public void displayDetail()
Console.WriteLine("PETROL : $" + petrol);
public class Manager : Employee
public Manager (string n, double s, string c, int by) : base(n, s, by)
public void displayDetail()
Console.WriteLine("CAR : " + car);
public class Clerk : Employee
public Clerk (string n, double s, int by, double cl) : base(n, s, by)
public void displayDetail()
Console.WriteLine("Cost of Living Allowance : $" + cola);
Officer staff1 = new Officer("Joyah", 3000, 300, 1975);
Officer staff2 = new Officer("Mat", 2000, 100, 1984);
Manager staff3 = new Manager("Minah", 8000, "Honda Accord", 1993);
Clerk staff4 = new Clerk("Selamat", 800, 1988, 50);
Console.WriteLine("----------- MYC ------------------");
Console.WriteLine("----------- MYC ------------------");
public static void Main ()
MyCompany myc = new MyCompany();