Esempio n. 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();
        }
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            CD cd = new CD("Jingle Bells", 700, "Audio", "CD");
            Dictionary <String, string> dictionary1 = new Dictionary <string, string>();

            dictionary1.Add("Track 1", "Believer");
            dictionary1.Add("Track 2", "Thunder");
            dictionary1.Add("Track 3", "Sugar");
            cd.Contents = dictionary1;

            DVD dvd = new DVD("The Lion King [DVD]", 4700, "Audio/Video", "DVD");
            Dictionary <String, string> dictionary2 = new Dictionary <string, string>();

            dictionary2.Add("Song1", "4.53");
            dictionary2.Add("Song2", "5.55");
            dictionary2.Add("Song3", "3.30");
            dvd.Contents = dictionary2;

            //Load Disc Info
            cd.DiscInfo();
            dvd.DiscInfo();

            cd.SpinDisc();
            dvd.SpinDisc();

            //Test for writeData method
            cd.WriteData(200);
            cd.WriteData(800);

            //readData
            cd.ReadData();
            dvd.ReadData();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            DVD dvd = new DVD("DVD example", 4700, 1450, "DVD-R");
            CD  cd  = new CD("CD example", 700, 350, "CD-RW");

            // TODO: Call each CD and DVD method to verify that they work as expected.

            dvd.SpinDisc();
            cd.SpinDisc();

            Console.WriteLine("\n");

            dvd.ReadData();
            cd.ReadData();

            Console.WriteLine("\n");

            Console.WriteLine(dvd.DiscInfo());
            Console.WriteLine(cd.DiscInfo());

            Console.WriteLine(dvd.WriteData(8000));
            Console.WriteLine(cd.WriteData(300));

            Console.WriteLine(dvd.DiscInfo());
            Console.WriteLine(cd.DiscInfo());

            dvd.AddFile("Funonabun", 20.00, ".jpg");
            cd.AddFile("Wannabe", 400.34, ".mp3");
            dvd.DiskContents();
            cd.DiskContents();
        }
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            List <Data> cdData     = new List <Data>();
            Data        musicData1 = new Data("Tearin' Up My Heart", 100);

            cdData.Add(musicData1);
            CD cd1 = new CD("NSYNC", "CD-DA", 700, cdData);

            List <Data> dvdData    = new List <Data>();
            Data        movieData1 = new Data("Chapter 10: Pirate Ship", 300);

            dvdData.Add(movieData1);
            DVD dvd1 = new DVD("The Goonies", "DVD-RAM", 5000, dvdData);

            // TODO: Call each CD and DVD method to verify that they work as expected.

            Data musicData2 = new Data("Bye Bye Bye", 100);

            cd1.SpinDisc();
            cd1.StoreData(musicData2);
            cd1.WriteData();
            cd1.ReadData();
            cd1.ReportInfo();

            Data movieData2 = new Data("Chapter 1: Jail Break", 300);

            dvd1.SpinDisc();
            dvd1.StoreData(movieData2);
            dvd1.WriteData();
            dvd1.ReadData();
            dvd1.ReportInfo();
        }
        static void Main(string[] args)
        {
            if (args.Count() > 0)
            {
                Console.WriteLine(args);
            }

            CD  cd  = new CD("Lamb of God", 500, 300);
            DVD dvd = new DVD("Cloverfield", 1500, 1400);

            cd.SpinDisc();
            dvd.SpinDisc();

            cd.ReadData();
            dvd.ReadData();

            Console.WriteLine(cd.WriteData(200));
            Console.WriteLine(dvd.WriteData(100));

            Console.WriteLine(cd.Info());
            Console.WriteLine(dvd.Info());

            //should throw because the disc is full
            //Console.WriteLine(cd.WriteData(1));
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            CD  cd  = new CD("CD example", 700, "CD-R", 350);
            DVD dvd = new DVD("DVD example", 4700, "DVD-R", 1450);

            cd.SpinDisc();
            dvd.SpinDisc();

            cd.ReadData();
            dvd.ReadData();

            Console.WriteLine(cd.WriteData(275));
            Console.WriteLine(dvd.WriteData(8000));

            Console.WriteLine(cd.DiskInfo());
            Console.WriteLine(dvd.DiskInfo());
        }
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            CD  cd  = new CD("CD example", 700, "CD-R", 350);
            DVD dvd = new DVD("DVD example", 4700, "DVD-R", 1450);

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

            cd.ReadData();
            dvd.ReadData();

            Console.WriteLine(cd.WriteData(275));
            Console.WriteLine(dvd.WriteData(8000));

            Console.WriteLine(cd.DiskInfo());
            Console.WriteLine(dvd.DiskInfo());
        }
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.
            List <string> tracks = new List <string>();

            tracks.Add("Track 1");
            tracks.Add("Track 2");
            tracks.Add("Track 3");
            tracks.Add("Track 4");
            tracks.Add("Track 5");

            CD myCd = new CD(500, "Luke Combs", "country", tracks);

            myCd.SpinDisc();
            myCd.LoadData();
            myCd.ReadData();
            myCd.StoreData();
            myCd.WriteData();
            myCd.DisplayMenu();
            myCd.DisplayData(tracks);



            List <string> chapters = new List <string>();

            chapters.Add("Chp 1");
            chapters.Add("Chp 2");
            chapters.Add("Chp 3");
            chapters.Add("Chp 4");

            DVD myDvd = new DVD(200, "Extraction", "Action", chapters);

            myDvd.SpinDisc();
            myDvd.LoadData();
            myDvd.ReadData();
            myDvd.StoreData();
            myDvd.WriteData();
            myDvd.DisplayMenu();
            myDvd.DisplayData(chapters);

            // TODO: Call each CD and DVD method to verify that they work as expected.
        }
        static void Main(string[] args)
        {
            // TODO: Declare and initialize a CD and a DVD object.

            IOpticalDisc myCD = new CD(256, 25, true);

            myCD.SpinDisc();

            myCD.ReadData();

            myCD.WriteData(25);

            myCD.ReadData();

            IOpticalDisc myDVD = new DVD(256, 256, false);

            myDVD.SpinDisc();
            myDVD.ReadData();

            // TODO: Call each CD and DVD method to verify that they work as expected.
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            CD  cd  = new CD("Test CD", 100, false);
            DVD dvd = new DVD("Test DVD", 4000, true);

            cd.SpinDisc();
            dvd.SpinDisc();

            cd.ReadDisc();
            dvd.ReadDisc();

            List <byte> testBytes = new List <byte>();

            testBytes.Add(0);
            testBytes.Add(1);
            testBytes.Add(2);
            testBytes.Add(3);

            Console.WriteLine(cd.WriteData(testBytes, 4));
            Console.WriteLine(dvd.WriteData(testBytes, 4));
            Console.WriteLine(dvd.WriteData(testBytes, 8000));
        }
        static void Main(string[] args)
        {
            // DECLARING AND INITIALIZING OBJECTS TO WORK WITH
            CD testCD = new CD("Foo Fighters", "The Colour and the Shape", 700, new List <string> {
                "Monkey Wrench", "Everlong", "My Hero"
            }, "CD");
            DVD testDVD = new DVD("Austin Powers: Goldmember", 4700, new List <string> {
                "Movie", "Unrated Version", "Special Features"
            }, "DVD");
            CD blankCD = new CD(700);

            //SPINDISC METHOD SIMPLY TELLS YOU HOW FAST EACH TYPE OF DISC SPINS
            testCD.SpinDisc();
            testDVD.SpinDisc();

            Console.WriteLine("\n*****\n");

            //REPORTDATA METHOD CAN BE CALLED DIRECTLY, BUT IT'S ALSO CALLED BY THE READDATA METHOD BELOW BECAUSE THAT MAKES MORE SENSE
            testCD.ReportData();
            testDVD.ReportData();
            blankCD.ReportData();

            Console.WriteLine("*****\n");

            //WRITEDATA METHOD REQUIRES USER INPUT
            testCD.WriteData();
            testDVD.WriteData();
            blankCD.WriteData();
            blankCD.ReportData();

            Console.WriteLine("\n*****");

            //THE LASER READS THE DATA ON THE DISC AND REPORTS WHAT IT FINDS
            testCD.ReadData();
            testDVD.ReadData();
        }