using System.Collections;
using System.Collections.Generic;
public string Street { get; set; }
public string City { get; set; }
public override string ToString()
return "Street: " + Street + "\nCity: " + City;
public Address HomeAddress { get; set; }
public string ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Person (string id , string firstName , string lastName)
this.FirstName = firstName;
this.LastName = lastName;
public virtual string GetInfo()
return "ID : " + this.ID + "\nName : " + this.FirstName + " " + this.LastName;
public override string ToString()
return GetInfo() + "\nAddress : " + HomeAddress.ToString();
public class Employee : Person
public string CompanyName{ get; set; }
public Employee (string id , string firstName , string lastName , string companyName) : base(id,firstName,lastName)
this.CompanyName = companyName;
public override string GetInfo()
return base.ToString() + "\nCompany : " + this.CompanyName ;
public class HomeAddress : Address
public static List<Employee> people;
private static void Initialise()
people = new List<Employee>();
public static void EmployeeAdd()
Console.WriteLine("Please supply the following Employee info: ");
string idInput = Console.ReadLine();
Console.Write("First Name : ");
string nameInput1 = Console.ReadLine();
Console.Write("Last Name : ");
string nameInput2 = Console.ReadLine();
Console.WriteLine("Street : ");
string streetName = Console.ReadLine();
Console.WriteLine("City : ");
string cityName = Console.ReadLine();
Console.WriteLine("Company : ");
string companyName = Console.ReadLine();
Console.WriteLine("Successfully added an employee!!");
Employee employee = new Employee(idInput, nameInput1,nameInput2,companyName)
HomeAddress = new Address
public static void EmployeeList()
Console.WriteLine("List for all Employees : ");
foreach(Employee person in people)
Console.WriteLine(person.GetInfo());
Console.WriteLine("--------------------------");
public static void Main()
Console.WriteLine("Please enter option x to exit or 1 to proceed to employee menu");
choice = Convert.ToChar(Console.ReadLine());
Console.WriteLine("Please enter option x to exit or 1 to proceed to employee menu");
choice = Convert.ToChar(Console.ReadLine());
Console.WriteLine("Exiting the program!!!");