Beispiel #1
0
        static void Main(string[] args)
        {
            CD Cd1 = new CD { Name = "Battle Metal", Artist = "Turisas" };
            Song song1 = new Song { SongName = "Victoriae & triumphi dominus", SongLength = 1.27 };
            Song song2 = new Song { SongName = "As Torches Rise", SongLength = 4.51 };
            Song song3 = new Song { SongName = "Battle Metal", SongLength = 4.23 };
            Song song4 = new Song { SongName = "The Land of Hope and Glory", SongLength = 6.22 };
            CD Cd2 =new CD { Name = "Varangian Way", Artist = "Turisas"};
            Song song5 = new Song { SongName = "To Holmgard and Beyond", SongLength = 5.17 };
            Song song6 = new Song { SongName = "A Portage to the Unknown", SongLength = 4.50 };
            Song song7 = new Song { SongName = "Cursed Be Iron", SongLength = 5.03 };
            Song song8 = new Song { SongName = "Fields of Gold", SongLength = 4.34 };
            //add songs to a CD
            Cd2.AddSong(song5);
            Cd2.AddSong(song6);
            Cd2.AddSong(song7);
            Cd2.AddSong(song8);

            Cd1.AddSong(song1);
            Cd1.AddSong(song2);
            Cd1.AddSong(song3);
            Cd1.AddSong(song4);

            //print collection
            Console.WriteLine(Cd1);
            Cd1.PrintCollection();
            Console.WriteLine(" ");
            Console.WriteLine(Cd2);
            Cd2.PrintCollection();
            Console.WriteLine(" ");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            CD cd = new CD { CdName = "Endless Forms", Artist = "Nightwish" };

            Song song1 = new Song { SongName = "Shudder", SongLenght = "6:29" };
            Song song2 = new Song { SongName = "Weak Fantasy", SongLenght = "5:23" };
            Song song3 = new Song { SongName = "Elan", SongLenght = "4:45" };

            cd.AddSong(song1);
            cd.AddSong(song2);
            cd.AddSong(song3);

            Console.WriteLine(cd.ToString());

            cd.PrintCollection();

            Console.ReadLine();

        }
Beispiel #3
0
        static void Main(string[] args)
        {
            CD metal = new CD();

            Song song1 = new Song { Name = "One", Artist = "Metallica", Length = 9, Price = "0.99e" };
            Song song2 = new Song { Name = "Run to the Hills", Artist = "Iron Maiden", Length = 8, Price = "0.87e" };
            Song song3 = new Song { Name = "Holy Diver", Artist = "Dio", Length = 6, Price = "0.55e" };
            Song song4 = new Song { Name = "Nightmare", Artist = "Avenged Sevenfold", Length = 7, Price = "1.23e" };
            Song song5 = new Song { Name = "Dystopia", Artist = "Megadeath", Length = 6, Price = "1.99e" };

            metal.AddSong(song1);
            metal.AddSong(song2);
            metal.AddSong(song3);
            metal.AddSong(song4);
            metal.AddSong(song5);

            metal.PrintCollection();

            Console.WriteLine("Pick a song from the CD: ");
            Song song6 = metal.GetSong(1);



        }