示例#1
0
        static void Main(string[] args)
        {
            Birds toucan = new Birds
            {
                Legs     = 2,
                Eat      = "omnivore",
                Pet      = "Maybe",
                End      = true,
                GotWings = true,
                Name     = "toucan",
                Color    = "rainbow colored",
                Famous   = "Toucan Sam: Cartoon toucan mascot for Froot Loops breakfast cereal.",
            };

            toucan.PrintBird();

            Reptile godzilla = new Reptile
            {
                Legs      = 2,
                Eat       = "carnivore",
                Pet       = "Definitely",
                End       = true,
                Radiation = true,
                Name      = "Godzilla",
                Color     = "grayish green colored",
                Famous    = "Godzilla is depicted as an enormous, destructive, prehistoric sea monster awakened and empowered by nuclear radiation. With the nuclear bombings of Hiroshima and Nagasaki and the Lucky Dragon 5 incident still fresh in the Japanese consciousness, Godzilla was conceived as a metaphor for nuclear weapons.",
            };

            godzilla.PrintRep();
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Animal animal = new Animal();
            Dogs   dog    = new Dogs();
            Birds  bird   = new Birds();

            bird.FeedAnimal();
        }
示例#3
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // Create a class Animal
            // give this class 4 members that all Animals have in common


            // Create a class Bird
            // give this class 4 members that are specific to Bird
            // Set this class to inherit from your Animal Class

            // Create a class Reptile
            // give this class 4 members that are specific to Reptile
            // Set this class to inherit from your Animal Class



            /*Create an object of your Bird class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */

            var Cardinal = new Birds();

            Cardinal.CantFly   = false;
            Cardinal.Migratory = false;
            Cardinal.IsEdible  = true;
            Cardinal.Passerene = true;

            Console.WriteLine(Cardinal.Legs);

            string chordata = null;

            Cardinal.Phylum = chordata;

            /*Create an object of your Reptile class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */

            var Copperhead = new Reptiles();

            Copperhead.LaysEggs = true;

            Animal Rattlesnake = new Reptiles();

            Rattlesnake.IsPoisonous = true;

            Console.WriteLine(Copperhead.Legs);

            Console.WriteLine($"A bird has {Cardinal.Legs} legs." + $"And it is {Copperhead.IsPoisonous} that is poisonous");
        }
示例#4
0
        static void Main(string[] args)
        {
            Birds myBird = new Birds();

            myBird.WingColor   = "blue";
            myBird.CanFly      = true;
            myBird.WillMigrate = true;
            myBird.Beak        = 6.4;

            Reptile myReptile = new Reptile()
            {
                IsColdBlooded = true,
                HasScales     = true,
                Habitat       = "swamp",
                CanGrowTail   = true
            };


            myReptile.Print();
        }
示例#5
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // DONE Create a class Animal
            // DONE give this class 4 members that all Animals have in common


            // DONE Create a class Bird
            // DONE give this class 4 members that are specific to Bird
            // DONE Set this class to inherit from your Animal Class

            // DONE Create a class Reptile
            // DONE give this class 4 members that are specific to Reptile
            // DONE Set this class to inherit from your Animal Class



            /*DONE Create an object of your Bird class
             * DONE give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */


            var newBird = new Birds();

            {
                newBird.FeatherColor = "Blue";
                newBird.WingLength   = 22.45;
                newBird.CanFly       = false;
                newBird.ChirpNoise   = "tweet tweet";
            };


            /*Create an object of your Reptile class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */

            var newReptile = new Reptiles();

            {
                newReptile.HasScales   = true;
                newReptile.LegCount    = 0;
                newReptile.IsPoisonous = true;
                newReptile.TailLength  = 26.74;
            };


            var myAnimals = new Animals[] { newBird, newReptile };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Land, Air, or Sea?: {animal.LandAirSea}");
                Console.WriteLine($"Age: {animal.Age}");
                Console.WriteLine($"Is Dangerous?: {animal.IsDangerous}");
                Console.WriteLine($"Weight?: {animal.Weight}");
                Console.WriteLine("");
            }
        }
示例#6
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // Create a class Animal
            // give this class 4 members that all Animals have in common


            // Create a class Bird
            // give this class 4 members that are specific to Bird
            // Set this class to inherit from your Animal Class

            // Create a class Reptile
            // give this class 4 members that are specific to Reptile
            // Set this class to inherit from your Animal Class



            /*Create an object of your Bird class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */


            Birds hedwig = new Birds()
            {
                Name          = "Hedwig",
                Age           = 29,
                Legs          = 2,
                HasClaws      = true,
                HasBeak       = true,
                Wings         = 2,
                Species       = "Snowy owl",
                IsWarmBlooded = true,
            };

            Console.WriteLine($" {hedwig.Name} is an {hedwig.Species} female that has" +
                              $" {hedwig.Wings} snowy white wings, {hedwig.Legs} black legs, and is also {hedwig.Age} years old");
            Console.WriteLine();
            Console.WriteLine($" Does {hedwig.Name} habe claws, a sharp beak, and warm blooded?" +
                              $" {hedwig.HasClaws}, {hedwig.HasBeak}, {hedwig.IsWarmBlooded}");
            Console.WriteLine();



            /*Create an object of your Reptile class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */


            Reptile hydra = new Reptile()
            {
                Name          = "Hydra",
                Age           = 1100,
                Legs          = 4,
                HasClaws      = true,
                Heads         = 6,
                Environment   = "Lake of Lerna",
                Type          = "Water",
                IsColdBlooded = true,
            };

            Console.WriteLine($" {hydra.Name} is {hydra.Age} years old with {hydra.Heads} heads and {hydra.Legs} legs." +
                              $" Lives in {hydra.Environment} as a gigantic {hydra.Type} serpent.");
            Console.WriteLine();
            Console.WriteLine($"Is {hydra.Name} cold blooded and has claws? {hydra.HasClaws}, {hydra.IsColdBlooded}");
            Console.WriteLine();
        }
示例#7
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // Create a class Animal
            // give this class 4 members that all Animals have in common


            // Create a class Bird
            // give this class 4 members that are specific to Bird
            // Set this class to inherit from your Animal Class

            // Create a class Reptile
            // give this class 4 members that are specific to Reptile
            // Set this class to inherit from your Animal Class



            /*Create an object of your Bird class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */
            var b1 = new Birds()
            {
                Species = "parot",
                Color   = "red",
                Sex     = "male",
                Legs    = 2,
                CanFly  = "yes",
                Wings   = 2,
                Beak    = "does have",
                LayEggs = "it does",
            };

            var lizard = new Reptiles()
            {
                Species     = "ingunana",
                Color       = "green",
                Sex         = "female",
                Legs        = 4,
                ChangeColor = "can not",
                Malt        = "it does",
                ColdBlood   = "it is",
                Posionus    = "is not"
            };


            var myAnimals = new Animals[] { b1, lizard };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"The Animal is a {animal.Species}");
                Console.WriteLine($"The Animal is the color {animal.Color}");
                Console.WriteLine($"The Animal is a {animal.Sex}");
                Console.WriteLine($"The Animal has {animal.Legs} legs");
                Console.WriteLine("");
            }



            /*Create an object of your Reptile class
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */
        }