using System.Collections.Generic;
public string Name { get; set; }
public string Education { get; set; }
public Customer(string name, string education, string email)
List<Customer> customerList = new List<Customer>();
customerList.Add(new Customer("John", "Bachelor", "john@gmail.com"));
customerList.Add(new Customer("David", "Bachelor", "david@iu.edu"));
customerList.Add(new Customer("Anderson", "Master", "anderson@iu.edu"));
customerList.Add(new Customer("Mary", "Master", "maryiu.edu"));
Console.WriteLine("Show All List");
foreach (Customer c in customerList)
Console.WriteLine("Name: " + c.Name.PadRight(15) + " Education: " + c.Education.PadRight(15) + " Email: " + c.Email.PadRight(15));
Console.WriteLine("=============================================");
Console.WriteLine("Show Email Length for all list");
foreach (Customer c in customerList)
Console.WriteLine("Email Length for " + c.Name + ": " + c.EmailLength());
Console.WriteLine("=============================================");
Console.WriteLine("Show Only Bachelor");
foreach (Customer c in customerList)
if (c.Education == "Bachelor")
Console.WriteLine("Name: " + c.Name.PadRight(15) + " Education: " + c.Education.PadRight(15) + " Email: " + c.Email.PadRight(15));