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)
static List<Customer> CustomerList = new List<Customer>();
public static void Main()
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"));
Console.WriteLine("Show List");
Console.WriteLine("=============================================");
foreach (var customer in CustomerList)
Console.WriteLine("{0,-15}{1,-15}{2,-15}", customer.Name, customer.Education, customer.Email);
Console.WriteLine("=============================================");
Console.WriteLine("Show Email Length for all the elements of the list");
foreach (var customer in CustomerList)
Console.WriteLine("{0,-15}{1,-15}", customer.Name, customer.EmailLength());
Console.WriteLine("=============================================");
Console.WriteLine("Show Only Bachelor Entries");
foreach (var customer in CustomerList)
if (customer.Education == "Bachelor")
Console.WriteLine("{0,-15}{1,-15}{2,-15}", customer.Name, customer.Education, customer.Email);