static void Main(string[] args) { //Console.WriteLine("Hello World!"); Coffee blackCoffee = new BlackCoffee(); Console.WriteLine("Prisen for Sort Kaffe er " + blackCoffee.Price()); Coffee latte = new Latte(); Coffee cortado = new Cortado(); Console.WriteLine("Prisen for Latte er " + latte.Price()); Console.WriteLine("Prisen for Cortado er " + cortado.Price()); Console.WriteLine(blackCoffee); Console.WriteLine(latte); Console.WriteLine(cortado); List <Coffee> listOfCoffee = new List <Coffee>(); listOfCoffee.Add(blackCoffee); listOfCoffee.Add(latte); listOfCoffee.Add(cortado); Console.WriteLine(); foreach (var hej in listOfCoffee) { Console.WriteLine(hej.Price()); Console.WriteLine(hej.ToString()); } }
static void Main(string[] args) { BlackCoffee black = new BlackCoffee(); Cortado corta = new Cortado(); Latte latte = new Latte(); Console.WriteLine($"The price is {black.Price()}kr and the strength is {black}."); Console.WriteLine($"The price is {corta.Price()}kr and the strength is {corta} with {corta.mlMilk()} ml milk."); Console.WriteLine($"The price is {latte.Price()}kr and the strength is {latte} with {latte.mlMilk()} ml milk."); }
static void Main(string[] args) { BlackCoffee black = new BlackCoffee(); Cortado cort = new Cortado(); Latte latte = new Latte(); Console.WriteLine($"The price of the coffe: {black.Price()} kr. {black}"); Console.WriteLine($"The price of the coffe: {cort.Price()} kr. {cort} It has {cort.mlMilk()}ml of milk"); Console.WriteLine($"The price of the coffe: {latte.Price()} kr. {latte} It has {latte.mlMilk()}ml of milk"); }