using System.Collections.Generic;
public string Name { get; set; }
public string Education { get; set; }
public string Email { get; set; }
public Customer(string N, string Ed, string Em)
static List<Customer> CustomerList = new List<Customer>();
public static void Main()
cusNew = new Customer("John", "Bachelor", "john@gmail.com");
CustomerList.Add(cusNew);
cusNew = new Customer("David", "Bachelor", "david@iu.edu");
CustomerList.Add(cusNew);
cusNew = new Customer("Anderson", "Master", "anderson@iu.edu");
CustomerList.Add(cusNew);
Console.WriteLine("Show List");
foreach (Customer c in CustomerList)
Name = c.Name.ToString();
Education = c.Education.ToString();
Email = c.Email.ToString();
output = Name.PadRight(15) + Education.PadRight(15) + Email.PadRight(15);
Console.WriteLine(output);
Console.WriteLine("=============================================");
Console.WriteLine("Show Email Length for all the elements of the list");
foreach (Customer c in CustomerList)
Console.WriteLine(c.EmailLength());
Console.WriteLine("=============================================");
Console.WriteLine("Show Only Bachelor Entries");
foreach (Customer c in CustomerList)
Name = c.Name.ToString();
Education = c.Education.ToString();
Email = c.Email.ToString();
if (Education == "Bachelor")
output = Name.PadRight(15) + Education.PadRight(15) + Email.PadRight(15);
Console.WriteLine(output);