using System.Collections.Generic;
public string FirstName {get; set;}
public string LastName {get; set;}
public DateTime Birthday {get; set;}
public int HeightInches {get; set;}
public string GetFullName(){
return $"{FirstName} {LastName}";
return DateTime.Now.Year - Birthday.Year;
public string GetHeightInFeetInches(){
return $"{HeightInches / 12}' {HeightInches % 12}\"";
public class PeopleFactory {
public static List<Person> GeneratePeople(){
List<Person> result = new List<Person>();
Random randomHeightInches = new Random();
Random randomBirthday = new Random();
for(int i = 0; i < 100; i++) {
Person person = new Person();
person.FirstName = "Person";
person.LastName = i.ToString();
person.HeightInches = randomHeightInches.Next(60, 76);
person.Birthday = new DateTime(randomBirthday.Next(1950, 2000), randomBirthday.Next(1, 13), randomBirthday.Next(1, 29));
public static void Main()
List<Person> peopleList = PeopleFactory.GeneratePeople();
foreach(Person person in peopleList){
Console.WriteLine($"{person.GetFullName()} is {person.GetAge()} years old. {person.GetHeightInFeetInches()}");
Person human = peopleList[32];
Console.WriteLine($"{human.GetFullName()} is {human.GetAge()} years old. {human.GetHeightInFeetInches()}");
Dictionary<string, Person> anotherPeopleList;
anotherPeopleList = new Dictionary<string, Person>();
anotherPeopleList.Add(human.LastName, human);
Person anotherPerson = anotherPeopleList["32"];
Console.WriteLine("Pulled out of a dictionary using last name. ");
Console.WriteLine($"{anotherPerson.GetFullName()} is {anotherPerson.GetAge()} years old. {anotherPerson.GetHeightInFeetInches()}");