コード例 #1
0
ファイル: Program.cs プロジェクト: JohnEnevoldsen/Coffee
        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());
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: JeppeHauman/Coffee
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            BlackCoffee blackCoffee = new BlackCoffee();
            Cortado     cortado     = new Cortado();
            Latte       latte       = new Latte();

            List <Coffee> CoffeeList = new List <Coffee>();

            CoffeeList.Add(blackCoffee);
            CoffeeList.Add(cortado);
            CoffeeList.Add(latte);

            foreach (var kaffe in CoffeeList)
            {
                System.Console.WriteLine(kaffe.ToString());
            }



            // System.Console.WriteLine(blackCoffee);
            // System.Console.WriteLine(cortado);
            // System.Console.WriteLine(latte);
        }
コード例 #3
0
        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.");
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: GlebOlsen/Coffee
        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");
        }
コード例 #5
0
        static void Main(string[] args)
        {
            BlackCoffee blackCoffee = new BlackCoffee();
            Cortado     cortado     = new Cortado();
            Latte       latte       = new Latte();

            List <Coffee> coffeeList = new List <Coffee>();

            System.Console.WriteLine(blackCoffee);
            Console.WriteLine(cortado);
            Console.WriteLine(latte);


            foreach (var kaffe in coffeeList)
            {
                System.Console.WriteLine(kaffe.ToString());
            }
        }