using System.Collections.Generic;
public string Name { get; set; }
public string Title { get; set; }
public string Department { get; set; }
public DateTime DateOfHire { get; set; }
public class EmployeeCollection : Dictionary<int, Employee>
public void AddEmployee(Employee employee)
if (!ContainsKey(employee.Key))
Insert(employee.Key, employee);
public void PrintEmployees()
foreach (var item in this)
Console.WriteLine(string.Format("{0} {1} {2} {3}", item.Key.ToString(), item.Value.Name, item.Value.Title, item.Value.DateOfHire.ToShortDateString()));
Console.WriteLine("Main Menu");
Console.WriteLine("1. Add Employee");
Console.WriteLine("2. Print Employees");
Console.WriteLine("3. Exit");
Console.WriteLine("Enter the number of the desired option:");
int selectedOption = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the employee's name:");
string name = Console.ReadLine();
Console.WriteLine("Enter the employee's title:");
string title = Console.ReadLine();
Console.WriteLine("Enter the employee's department:");
string department = Console.ReadLine();
Console.WriteLine("Enter the employee's start date in the format of mm/dd/yyyy:");
DateTime dateOfHire = DateTime.ParseExact(Console.ReadLine(), "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
var employee = new Employee