Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Beagle beagle = new Beagle();

            Console.WriteLine(beagle.IsHunter);
            Console.WriteLine(beagle.DoTrick());
            Console.WriteLine(beagle.EatFood());
            Console.WriteLine(beagle.FormsGroup());
            Console.WriteLine(beagle.MakesBabies());
            Console.WriteLine(beagle.LearnTrick());

            Husky husky = new Husky();

            Console.WriteLine(husky.LovesSnow);
            Console.WriteLine(husky.DoTrick());
            Console.WriteLine(husky.EatFood());
            Console.WriteLine(husky.FormsGroup());
            Console.WriteLine(husky.MakesBabies());
            Console.WriteLine(husky.LearnTrick());

            Chimpanzee chimp = new Chimpanzee();

            Console.WriteLine(chimp.HasHeart);
            Console.WriteLine(chimp.NumberOfLegs);
            Console.WriteLine(chimp.EatFood());
            Console.WriteLine(chimp.FormsGroup());
            Console.WriteLine(chimp.MakesBabies());
            Console.WriteLine(beagle.MakeSound());

            Dolphin dolphin = new Dolphin();

            Console.WriteLine(dolphin.HasHeart);
            Console.WriteLine(dolphin.BreathesAir);
            Console.WriteLine(dolphin.HasScales);
            Console.WriteLine(dolphin.DoTrick());
            Console.WriteLine(dolphin.EatFood());
            Console.WriteLine(dolphin.EatsHumans());
            Console.WriteLine(dolphin.MakesBabies());
            Console.WriteLine(dolphin.MakeSound());

            Shark shark = new Shark();

            Console.WriteLine(shark.HasHeart);
            Console.WriteLine(shark.BreathesAir);
            Console.WriteLine(shark.HasScales);
            Console.WriteLine(shark.EatFood());
            Console.WriteLine(shark.EatsHumans());
            Console.WriteLine(shark.MakeSound());
        }
Exemple #2
0
        static void DisplayNames()
        {
            Human   human   = new Human();
            Whale   whale   = new Whale();
            Dolphin dolphin = new Dolphin();
            SeaLion seaLion = new SeaLion();
            Ape     ape     = new Ape();


            human.GivesBirth();
            dolphin.Sound(dolphin.Name);
            ape.PlaysGames();
            whale.TypeOfEater();
            seaLion.Breathe();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            // make animals
            Skunk   skunk   = new Skunk();
            Weasel  weasel  = new Weasel();
            Bear    bear    = new Bear();
            Lion    lion    = new Lion();
            Wolf    wolf    = new Wolf();
            Narwhal narwhal = new Narwhal();
            Dolphin dolphin = new Dolphin();
            Orca    orca    = new Orca();

            // make dinner
            IAmDinner rat      = new OtherEdibleCritters();
            IAmDinner mole     = new OtherEdibleCritters();
            IAmDinner guppy    = new OtherEdibleCritters();
            IAmDinner salmon   = new OtherEdibleCritters();
            IAmDinner tuna     = new OtherEdibleCritters();
            IAmDinner sturgeon = new OtherEdibleCritters();
            IAmDinner bass     = new OtherEdibleCritters();

            // setting the stage
            Console.WriteLine("Chaos at the zoo!  All of the enclosures have been torn down by angry environmentalists, and the animals are out of control!");

            // skunk eats mole and births 3 babies
            Console.WriteLine("");
            skunk.Eat(mole);
            skunk.GiveBirth(3);

            // weasel eats rat and births 6 babies
            Console.WriteLine("");
            weasel.Eat(rat);
            weasel.GiveBirth(6);

            // lion and wolf each feast at the newly stocked weasel buffet
            Console.WriteLine("");
            lion.Eat(weasel);
            wolf.Eat(weasel);

            // wolf is expecting, so she also eats a bass
            Console.WriteLine("");
            wolf.Eat(bass);
            wolf.GiveBirth(3);

            // lion also had some buns in the oven
            Console.WriteLine("");
            lion.GiveBirth(4);

            // bear went out for dinner, and then went home to have babies and a nap
            Console.WriteLine("");
            bear.Travel();
            bear.Eat(salmon);
            bear.Travel();
            bear.GiveBirth(1);

            // meanwhile, in the water, everyone had babies!
            Console.WriteLine("");
            narwhal.GiveBirth(1);
            orca.GiveBirth(1);
            dolphin.GiveBirth(1);

            // ...and got hungry
            Console.WriteLine("");
            narwhal.Eat(guppy);
            dolphin.Eat(sturgeon);
            orca.Eat(narwhal);
            orca.Eat(dolphin);

            Console.ReadLine();
        }