using System.Collections.Generic;
public static void Main(string[] args)
Console.WriteLine("Good morning.");
Console.WriteLine("The objects are initialized after this line.");
Console.WriteLine("The SMS message from the 11th youngest owner is below.");
Console.WriteLine("The SMS messages from all 20 items are below.");
Console.WriteLine("The SMS messages from the remaining 10 items are below.");
Console.WriteLine("The objects are disposed after this line.");
Console.WriteLine("Thank you.");
public static List<string> CreatePhoneList()
List<string> newList = new List<string>();
for(int i = 0; i < 10; i++)
var android = new AndroidPhone();
var ios = new IosPhone();
android.OwnerUserName = "username"+i;
android.OwnerBirthdate = new DateTime(i);
ios.OwnerUserName = "username"+i;
ios.OwnerBirthdate = new DateTime(i);
public abstract class SmartPhone
private string _phoneType;
_phoneType = "Smart Phone";
public Guid Id { get; private set; }
public string OwnerUserName { get; set; }
public DateTime OwnerBirthdate { get; set; }
public void SendSms(string message)
Console.WriteLine(message);
Console.WriteLine("Sent from my {0}.", _phoneType);
public class AndroindSendSms : SmartPhone
private string _phoneType;
_phoneType = "Adnroid Phone";
new public void SendSms(string message, string username, string birthday)
Console.WriteLine("message: {0} from user {1} with birthday of {2}.", message,username,birthday);
Console.WriteLine("Sent from my {0}.", _phoneType);
public class AndroidPhone : SmartPhone
public string _phoneType;
var test = new AndroindSendSms();
test.SendSms("hello","shaun","September 5 1992");
public class IosPhone: SmartPhone
public string _phoneType;
new public void SendSms(string message, string username, string birthday, string age)
Console.WriteLine("message: {0} from user {1} with birthday of {2} and age of {3}", message,username,birthday,age);
Console.WriteLine("Sent from my {0}.", _phoneType);