using System.Collections.Generic;
public string Name {get;set;}
public string Education {get;set;}
private string _email = "N/A";
set{_email = value.Contains("@") ? value : "N/A";}
public Customer(string name, string education, string email)
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("Name:" + c.Name.PadRight(15) + "Education:" + 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("Name:" + c.Name.PadRight(15)+ "Email Length: " + 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) + c.Email.PadRight(15));