Beispiel #1
0
        private static void WelcomeToTheZoo()
        {
            Console.WriteLine("Welcome to my zoo!");



            Console.Write("We have a Lion that:");

            Lion lion = new Lion();

            Console.WriteLine(lion.Scratch());


            Console.Write("We have a Tiger that:");

            Tiger tiger = new Tiger();

            Console.WriteLine(tiger.Hunt());


            Console.Write("We have a Bear that:");

            Bear bear = new Bear();

            Console.WriteLine(bear.Sleep());


            Console.Write("We have a Crocodile that:");

            Crocodile crocodile = new Crocodile();

            Console.WriteLine(crocodile.Move());


            Console.Write("And a Velociraptor that:");

            Velociraptor velociraptor = new Velociraptor();

            Console.WriteLine(velociraptor.Move());

            Console.WriteLine("This is probably the best zoo ever");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Zoo!");

            Cow       cow       = new Cow();
            BlackBear blackbear = new BlackBear();
            PolarBear polarBear = new PolarBear();
            Ostrich   ostrich   = new Ostrich();
            Goose     goose     = new Goose();
            Tortise   tortise   = new Tortise();
            Crocodile crocodile = new Crocodile();

            Console.WriteLine($"Cow: {cow.PlowField()}");
            Console.WriteLine($"Black Bear: {blackbear.ClimbTree()}");
            Console.WriteLine($"Polar Bear: {polarBear.Sleep()}");
            Console.WriteLine($"Polar Bear: {polarBear.Prey}");
            Console.WriteLine($"Polar Bear: {polarBear.HuntingGround()}");
            Console.WriteLine($"Ostrich: {ostrich.Sprint()}");
            Console.WriteLine($"Ostrich: {ostrich.Race()}");
            Console.WriteLine($"Ostrich: When I race, do I wear blinders? {ostrich.WearBlinders}");
            Console.WriteLine($"Goose: {goose.Sound()}");
            Console.WriteLine($"Tortise: {tortise.HideInShell()}");
            Console.WriteLine($"Crocodile: {crocodile.BirdTeethClean()}");
        }