using System.Collections.Generic;
public string Name { get; set; }
public string Education { get; set; }
set { _email = value.Contains("@") ? value : "N/A"; }
public Customer(string n, string edu, string e)
public 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 customer in CustomerList)
Console.WriteLine("Name: " + customer.Name.PadRight(15) + "Education: " + customer.Education.PadRight(15) + "Email: " + customer.Email.PadRight(15));
Console.WriteLine("=============================================");
Console.WriteLine("Show Email Length for all list");
foreach (Customer customer in CustomerList)
Console.WriteLine("Name: " + customer.Name.PadRight(15) + "Email Length: " + customer.EmailLength());
Console.WriteLine("=============================================");
Console.WriteLine("Show Only Bachelor");
foreach (Customer customer in CustomerList)
if (customer.Education == "Bachelor")
Console.WriteLine("Name: " + customer.Name.PadRight(15) + "Education: " + customer.Education.PadRight(15) + "Email: " + customer.Email.PadRight(15));