Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("My Animals");
            Console.WriteLine("-------------");

            Dog myDog = new Dog("Staffy", "Mark");

            myDog.Name = " Wednesday";
            Console.WriteLine("Name: " + myDog.Name);
            myDog.OwnerName = " Mark";
            Console.WriteLine("Owner:" + myDog.OwnerName);
            myDog.Breed = " Dog - Staffy";
            Console.WriteLine("Breed:" + myDog.Breed);
            myDog.Talk();
            myDog.Move();
            Console.WriteLine();

            Cat myCat = new Cat("Max", "Tabby");

            myCat.Name = " Max";
            Console.WriteLine("Name:" + myCat.Name);
            myCat.OwnerName = " Mark";
            Console.WriteLine("Owner:" + myCat.OwnerName);
            myCat.Breed = " Cat - Tabby";
            Console.WriteLine("Breed:" + myCat.Breed);
            myCat.Talk();
            myCat.Move();
            Console.WriteLine();

            Bear myBear = new Bear("Cayde", "Mark", "Grizzly", "Brown");

            myBear.Name = " Cayde";
            Console.WriteLine("Name: " + myBear.Name);
            myBear.OwnerName = " Mark";
            Console.WriteLine("Owner:" + myBear.OwnerName);
            myBear.Breed = " Bear - Grizzly";
            Console.WriteLine("Breed:" + myBear.Breed);
            myBear.Color = " Brown";
            Console.WriteLine("Color:" + myBear.Color);
            myBear.Talk();
            myBear.Move();


            Console.ReadLine();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Mammal m1 = new Mammal();
            Mammal m2 = new Mammal(7, "Herbivore");

            Console.WriteLine(m1.diet);
            Console.WriteLine(m2.diet);
            m1.MakeNoise();
            m2.MakeNoise();
            Bear b1 = new Bear();

            Console.WriteLine(b1.legs);
            Bear b2 = new Bear(4, "Honey Diet", "Yellow", "100 Acre Woods", true, 2);

            Console.WriteLine(b2.habitat);
            b2.MakeNoise2("TIGERRRRRR");
            b2.printStats();
            //YES
            Mammal b3 = new Bear();

            //NO
            //Bear m3 = new Mammal();
            b3.MakeNoise();
        }