Пример #1
0
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            CD  myCD  = new CD("Cool CD");
            DVD myDVD = new DVD("Cool DVD");

            // TODO: Call each CD and DVD method to verify that they work as expected.
            myCD.SpinDisc();
            Console.WriteLine(myCD.ToString());
            myCD.WriteData("What");
            myCD.WriteData("is");
            myCD.WriteData("this");
            myCD.WriteData("doing?");
            Console.WriteLine(myCD.ToString());
            myCD.ReadData();


            myDVD.SpinDisc();
            Console.WriteLine(myDVD.ToString());
            myDVD.WriteData("All");
            myDVD.WriteData("the");
            myDVD.WriteData("pretty");
            myDVD.WriteData("horses");
            Console.WriteLine(myDVD.ToString());
            myDVD.ReadData();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            CD  Cd1  = new CD("First CD");
            DVD Dvd1 = new DVD("First DVD");

            // TODO: Call each CD and DVD method to verify that they work as expected.
            Cd1.SpinDisc();
            Dvd1.SpinDisc();

            Console.WriteLine("\n" + Cd1.ToString());
            Console.WriteLine(Dvd1.ToString());
        }