static void Main(string[] args) { CD cd = new CD { Name = "Endless Forms Most Bautiful", Artist = "Nightwish" }; Song track1 = new Song { Single = "Shudder Before the beautiful", Duration = "6:29"}; Song track2 = new Song { Single = "Weak Fantasy", Duration = "5:23" }; Song track3 = new Song { Single = "Elan", Duration = "4:45" }; Song track4 = new Song { Single = "Yours Is an Empty Hope", Duration = "5:34" }; Song track5 = new Song { Single = "Our Decades in the Sun", Duration = "6:37" }; Song track6 = new Song { Single = "My Walden", Duration = "4:38" }; Song track7 = new Song { Single = "Endless Forms Most Bautiful", Duration = "5:07" }; Song track8 = new Song { Single = "Edema Ruh", Duration = "5:15" }; Song track9 = new Song { Single = "Alpenglow", Duration = "4:45" }; Song track10 = new Song { Single = "The Eyes of Sharbat Gula", Duration = "6:03" }; Song track11 = new Song { Single = "The Greatest Show on Earth", Duration = "24:00" }; cd.AddSong(track1); cd.AddSong(track2); cd.AddSong(track3); cd.AddSong(track4); cd.AddSong(track5); cd.AddSong(track6); cd.AddSong(track7); cd.AddSong(track8); cd.AddSong(track9); cd.AddSong(track10); Console.WriteLine(cd.ToString()); }
static void Main(string[] args) { CD cd = new CD(); cd.Artist = "Hate"; cd.AlbumTitle = "Solarflesh"; cd.Price = "11,90"; Track song1 = new Track { Title = "Watchful Eye Ov Doom", Length = "3:20" }; Track song2 = new Track { Title = "Eternal Might", Length = "6:08" }; Track song3 = new Track { Title = "Alchemy Ov Blood", Length = "4:58" }; Track song4 = new Track { Title = "Timeless Kingdom", Length = "5:31" }; Track song5 = new Track { Title = "Festival Ov Slaves", Length = "4:34" }; Track song6 = new Track { Title = "Sadness Will Last Forever", Length = "7:05" }; Track song7 = new Track { Title = "Solarflesh", Length = "5:35" }; Track song8 = new Track { Title = "Endless Purity", Length = "5:42" }; Track song9 = new Track { Title = "Mesmerized", Length = "4:51" }; cd.AddTrack(song1); cd.AddTrack(song2); cd.AddTrack(song3); cd.AddTrack(song4); cd.AddTrack(song5); cd.AddTrack(song6); cd.AddTrack(song7); cd.AddTrack(song8); cd.AddTrack(song9); cd.PrintData(); }
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(" "); }
static void Main(string[] args) { // create new cd object (register) CD cd = new CD(); cd.Artist = "Sanni"; cd.Price = 25; // create new song object Song song = new Song(); song.Name = "Supernova"; song.Length = 210; Song song1 = new Song(); song1.Name = "Jos mä oon oikee"; song1.Length = 190; Song song2 = new Song(); song2.Name = "2080-luvulla"; song2.Length = 180; // add songs to cd cd.AddSong(song); cd.AddSong(song1); cd.AddSong(song2); // get one song from cd Song songget = cd.GetSong(0);// index = 0 cd.PrintData(); if (songget != null) { Console.WriteLine("First song in my cd is " + songget.ToString()); } else { Console.WriteLine("Can't find song in that index"); } Console.WriteLine(); string name = "2080-luvulla"; Console.WriteLine("Finding song with name: " + name); Song song5 = cd.FindSong(name); if (song5 != null) { Console.WriteLine(song5.ToString()); } else { Console.WriteLine("Can't find song with that name"); } Console.ReadLine(); }
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(); }
static void Main(string[] args) { string song1 = "Toot"; string song2 = "truut"; string song3 = "pruut"; string song4 = "tuut"; string song5 = "Jee"; string song6 = "Jippii"; List <string> Sounds = new List <string>(); Sounds.Add(song1); Sounds.Add(song2); Sounds.Add(song3); Sounds.Add(song4); Sounds.Add(song5); Sounds.Add(song6); CD cd = new CD ( "Holidays", "best singer", Sounds ); int k = 0; Console.WriteLine("CD Data: "); Console.WriteLine("CD Name: " + cd.Name); Console.WriteLine("Artist: " + cd.Artist); Console.WriteLine("Songs: "); foreach (string a in cd.Song) { k++; Console.WriteLine(k + ". " + a); } Console.ReadLine(); }
static void Main(string[] args) { CD cd = new CD {Name = "The Mantle", Artist = "Agalloch" }; Song song1 = new Song { Name = "A Celebration for the death of man...", Duration = "2:24"}; Song song2 = new Song { Name = "In the shadow of our pale companion", Duration = "14:44"}; Song song3 = new Song { Name = "Odal", Duration = "7:38" }; Song song4 = new Song { Name = "I am the wooden doors", Duration = "6:10"}; Song song5 = new Song { Name = "The Lodge", Duration = "4:39" }; Song song6 = new Song { Name = "You were but a ghost in my arms", Duration = "9:13" }; Song song7 = new Song { Name = "The Hawthrone passage", Duration = "11:17" }; Song song8 = new Song { Name = "...And the great cold death of the earth", Duration = "7:13" }; Song song9 = new Song { Name = "A Desolation song", Duration = "5:07" }; cd.AddSong(song1); cd.AddSong(song2); cd.AddSong(song3); cd.AddSong(song4); cd.AddSong(song5); cd.AddSong(song6); cd.AddSong(song7); cd.AddSong(song8); cd.AddSong(song9); Console.WriteLine("Name: " + cd.Name + " Artist: " + cd.Artist); Console.WriteLine(song1.ToString()); Console.WriteLine(song2.ToString()); Console.WriteLine(song3.ToString()); Console.WriteLine(song4.ToString()); Console.WriteLine(song5.ToString()); Console.WriteLine(song6.ToString()); Console.WriteLine(song7.ToString()); Console.WriteLine(song8.ToString()); Console.WriteLine(song9.ToString()); }
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); }