using System.Collections.Generic;
public string Name { get; set; }
public string Education { get; set; }
public string Email { get; set; }
public Customer(string name, string education, string email)
public override string ToString()
return Name.PadRight(15) + Education.PadRight(15) + Email.PadRight(15);
CustomerList = new List<Customer>();
public static void Main()
Customer customer = new Customer("John", "Bachelor", "john@gmail.com");
CustomerList.Add(customer);
customer = new Customer("David", "Bachelor", "david@iu.edu");
CustomerList.Add(customer);
customer = new Customer("Anderson", "Master", "anderson@iu.edu");
CustomerList.Add(customer);
Console.WriteLine("Show Master List");
foreach (Customer c in CustomerList)
Console.WriteLine(c.ToString());
Console.WriteLine("=============================================");
Console.WriteLine("Show Email Length for all entries");
foreach (Customer c in CustomerList)
Console.WriteLine(c.EmailLength());
Console.WriteLine("=============================================");
Console.WriteLine("Show Only Entries with Bachelor as the Education");
foreach (Customer c in CustomerList)
if (c.Education == "Bachelor")
Console.WriteLine(c.ToString());