using System.Collections;
using System.Collections.Generic;
public static void Main()
Supervisor patrick = new Supervisor {Name = "Patrick", Rating = 3, EmployeeId = 1};
Employee foley = new Employee {Name = "Foley", Rating = 3, EmployeeId = 2};
Employee ryan = new Employee {Name = "Ryan", Rating = 3, EmployeeId = 3};
Supervisor jay = new Supervisor {Name = "Jay", Rating = 3, EmployeeId = 4};
Employee yusuf = new Employee {Name = "Yusuf", Rating = 3, EmployeeId = 5};
patrick.AddSubordinate(foley);
patrick.AddSubordinate(yusuf);
jay.AddSubordinate(patrick);
jay.AddSubordinate(ryan);
jay.PerformanceSummary();
patrick.PerformanceSummary();
public interface IEmployee {
int EmployeeId {get; set;}
void PerformanceSummary();
public class Employee : IEmployee {
public int EmployeeId {get; set;}
public string Name {get; set;}
public int Rating {get; set;}
public void PerformanceSummary() {
string msg = string.Format("{0} has a rating of {1}\n",Name,Rating);
public class Supervisor : IEmployee {
public int EmployeeId {get; set;}
public string Name {get; set;}
public int Rating {get; set;}
public void PerformanceSummary() {
string msg = string.Format("{0} has a rating of {1}\n",Name,Rating);
Console.WriteLine("Subordinate summary:\n");
foreach(var subordinate in ListSubordinates) {
subordinate.PerformanceSummary();
public List<IEmployee> ListSubordinates = new List<IEmployee>();
public void AddSubordinate(IEmployee subordinate) {
ListSubordinates.Add(subordinate);