static void Main(string[] args) { Produto Skyrim = new JogoDigital("The Elder Scrolls V: Skyrim Special Edition", 169.90, "Pc"); Produto PathOfExile = new JogoDigital("Path of Exile", 00.00, "Pc"); Produto HarryPotter = new Livro("Harry Potter e a Câmara Secreta", 29.99, "J. K. Rowling"); Produto Cthulhu = new Livro("call of cthulhu", 42.90, "H.P lovecraft"); Produto[] produtos = { Skyrim, PathOfExile, HarryPotter, Cthulhu }; foreach (Produto item in produtos) { item.InformarDescrição(); item.InformarPreço(); Console.WriteLine("--------------------------------"); Console.ReadLine(); } }
static void Main(string[] args) { Produto jogo0 = new JogoDigital("FIFA20", 200, "PS5"); Produto jogo1 = new JogoDigital("God of War", 5, "PS2"); Produto livro0 = new Livro("O principe", 40, "Maquiavel"); Produto livro1 = new Livro("Arte da Guerra", 60, "Sun Tzu"); Produto[] produtos = { jogo0, jogo1, livro0, livro1 }; foreach (Produto item in produtos) { item.InformarDescricao(); item.InformarPreco(); Console.WriteLine("\n---------------------------------"); Console.ReadLine(); } }