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