using System;
class Employee
{
// Create three properties for employee; Use Auto-Implementation
public string Name { set; get; }
public string Title { set; get; }
public int Age { set; get; }
// Create default constructor for Employee (without any parameters)
public Employee()
}
// Create constructor with three parameters and set up the value for Name, Title, and Age
public Employee(string n, string t, int a)
Name = n;
Title = t;
Age = a;
// Create a function
// Function name: ShowDetail
// Input: N/A
// Output: string
// Rule: return Title + ": " + Name
public string ShowDetail()
string strReturn = "";
strReturn = Title + ": " + Name;
return strReturn;
// [Code] Create a Class "Staff" that inherits from the Class Employee
// 1. Create one property for Staff: double DailyWage
// 2. Create base constructor without any parameters.
// 3. Create second constructor with four parameters and set up the value for Name, Title, Age, and DailyWage
// 4. [Code] Create a function
// Function name: CalculateTotalWage
// Input: int nDays, bool bExtraBonus
// Output: double
// Rule:
// (a) return total wage = # days * daily wage
// (b) if bExtraBonus is true
// (b.1) Add 1000 to total wage for age > 60
// (b.2) Add 500 to total wage for other cases
// [Code] Create a Class "Manager" that inherits from the Class Employee
// 1. Create one property for Manager: double YearlyWage
// 2. Create base constructor without any parameters
// 3. Create second constructor with four parameters and set up the value for Name, Title, Age, and YearlyWage
// 4. Create a function
// Function name: ShowDetail (hide the parent function)
// Rule: return Title + "(manager): " + Name
// 5.Create a function
// Input: bool bExtraBonus
// (a) return total wage = YearlyWage
// (b) if bExtraBonus is true, add 3000
public class Program
public static void Main()
// 1.1 [Code] Create a staff by using the second contructor
// Name: John; Title: Specialist; Age: 28; DailyWage: 120
// 1.2 [Question] Can you show the newly created staff's name? Y/ N
// Ans:
// Why: (one sentence)
// 1.3 [Question] Can you show the newly created staff's title? Y/ N
// 1.4 [Code] Call ShowDetail and use Console.WriteLine() to show the results
// 1.5 [Code] Call this staff's CalculateTotalWage
// nDays: 250; bExtraBonus: true
// What is the result?
// 2.1 [Code] Create a manager here
// Name: Mary; Title: Manager; Age: 42; YearlySalary: 78500
// 2.2 [Code] Call ShowDetail and use Console.WriteLine() to show the results
// [Question] Why is the result different from staff's result?
// 2.3 [Code] Call this manager's CalculateTotalWage
// bExtraBonus: true