public Employee(int employeeId, string fullName, float salary, bool taxDeducted)
this.employeeId = employeeId;
this.fullName = fullName;
this.taxDeducted = taxDeducted;
public Employee(int employeeId, string fullName, float salary)
this.employeeId = employeeId;
this.fullName = fullName;
public float getNetSalary()
return (float) (this.salary * 0.8);
return (float) this.salary;
public void printInformation()
Console.WriteLine (this.employeeId + ", " + this.fullName + " earns " +
this.getNetSalary() + " per month.");
class WeeklyEmployee : Employee
public void printInformation()
Console.WriteLine (this.employeeId + ", " + this.fullName + " earns " +
this.getNetSalary() + " per week.");
public static void Main()
Employee first = new Employee(100001,"Donald Trump", 12345, true);
Employee second = new Employee(100002,"Joe Biden", 23456);
Console.WriteLine("Hello World");
Console.WriteLine(first.fullName);
Console.WriteLine(second.employeeId+" "+second.taxDeducted);
Console.WriteLine(second.getNetSalary());
first.printInformation();