예제 #1
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 done
            // 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
             *
             */

            /*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 myBird = new Bird();

            myBird.WingColor  = "Blue";
            myBird.CanFly     = true;
            myBird.DoMigrate  = true;
            myBird.BeakLength = 3.5;

            var lizard = new Reptile()
            {
                IsColdBlooded = true,
                IsScaly       = true,
                Habitat       = "swamp",
                CanGrowTail   = true
            };

            var myAnimals = new Animal[] { myBird, lizard };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Alive:{animal.IsAlive}");
                Console.WriteLine();
                Console.WriteLine($"Age:{animal.Age} years old");
                Console.WriteLine();
                Console.WriteLine($"It has:{animal.LegCount} legs");
                Console.WriteLine();
                Console.WriteLine($"It lives by: {animal.LandSeaAir}");
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            var myBird = new Bird();

            myBird.WingColor   = "blue";
            myBird.CanFly      = true;
            myBird.WillMigrate = true;
            myBird.BeakLength  = 3.5;

            var lizard = new Reptile()
            {
                IsColdBlooded = true,
                IsScaly       = true,
                Habitat       = "swamp",
                CanGrowTail   = true
            };

            var myAnimals = new Animal[] { myBird, lizard };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine(animal);
                Console.WriteLine($"Alive:{ animal.IsAlive}");
                Console.WriteLine($"Age:{ animal.Age} years old");
                Console.WriteLine($"It has:{ animal.LegCount} legs");
                Console.WriteLine($"It lives by:{ animal.LandSeaAir}");
                Console.WriteLine();
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            /*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
             */
            //Bird myBird = new Bird(); use inference best practice
            var myBird = new Bird();

            myBird.WingColor   = "blue";
            myBird.CanFly      = true;
            myBird.WillMigrate = true;
            myBird.BeakLength  = 3.5;

            var lizard = new Reptile()
            {
                IsColdBlooded = true,
                IsScaly       = true,
                Habitat       = "Swamp",
                CanGrowTail   = true
            };

            var myAnimals = new Animal[] { myBird, lizard };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Alive:{animal.IsAlive}");
                Console.WriteLine($"Age:{animal.Age} years old");
                Console.WriteLine($"It has {animal.LegCount} legs");
                Console.WriteLine($"It lives by {animal.LandSeaAir}");
                Console.WriteLine($"");
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            var myBird = new Bird();
            {
                myBird.Legs        = 2;
                myBird.Size        = 2;
                myBird.HasFeathers = true;
            }

            var lizard = new Reptile();
            {
                lizard.HasScales   = true;
                lizard.EyeShape    = "Football";
                lizard.ColdBlooded = true;
                lizard.Length      = 25;
            }

            var myAnimals = new Animal[] { myBird, lizard };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Has a Tail, {animal.HasTail}");
                Console.WriteLine($"Legs, {animal.Legs}");
                Console.WriteLine($"Color, {animal.Color}");
                Console.WriteLine($"");
            }
        }
예제 #5
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();
        }
예제 #6
0
        static void Main(string[] args)
        {
            var eagle = new Bird();

            eagle.CanFly      = true;
            eagle.HasClaws    = true;
            eagle.HasFeathers = true;
            eagle.HasWings    = true;

            Console.WriteLine($"Write true or false for each of the following statements. \n" +
                              $"An eagle can fly: {eagle.CanFly}\n" +
                              $"An eagle has claws: {eagle.HasClaws}\n" +
                              $"An eagle has feathers: {eagle.HasFeathers}\n" +
                              $"An eagle has wings: {eagle.HasWings}\n");

            var snake = new Reptile()
            {
                HasScales     = true,
                HasTail       = true,
                IsColdBlooded = true,
                LaysEggs      = true
            };

            Console.WriteLine($"HasScales = {snake.HasScales}\n" +
                              $"HasTail = {snake.HasTail}\n" +
                              $"IsColdBlooded = {snake.IsColdBlooded}\n" +
                              $"LaysEggs = {snake.LaysEggs}\n");
        }
예제 #7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Today, we'll look at two different sorts of animals: birds and reptiles.");
            Console.WriteLine("For each kind, we'll look at one example.  First up, birds.  Here's one for you: the heron");

            var heron = new Bird();

            heron.ActiveTime   = "Day";
            heron.Diet         = "Fish";
            heron.Environment  = "Marshes";
            heron.Wingspan     = 65.93;
            heron.FeatherColor = "Blue";
            heron.DoesItFly    = true;
            heron.Noise        = "Honk";

            Console.WriteLine($"Herons usually come out during the {heron.ActiveTime} and feed on {heron.Diet}, among other things, while roaming the {heron.Environment}.");
            Console.WriteLine($"They have wings {heron.Wingspan} inches long, and some of them have {heron.FeatherColor} feathers.");
            Console.WriteLine("--------------------------------------------------------");
            Console.WriteLine("And now to take a look at a reptile, specifically a snake they call the Copperhead.");

            var copperhead = new Reptile();

            copperhead.Skin        = "Scaly";
            copperhead.ActiveTime  = "Night";
            copperhead.Diet        = "Rodents";
            copperhead.Environment = "Woods";
            copperhead.IsVenomous  = true;
            copperhead.HasLegs     = false;
            copperhead.ScaleColor  = "Copper";
            copperhead.HasScales   = true;

            Console.WriteLine($"Like many reptiles, the Copperhead has {copperhead.Skin} skin of a {copperhead.ScaleColor} color, hence the name.");
            Console.WriteLine($"They usually come out at {copperhead.ActiveTime} and subsists primarily on {copperhead.Diet} and sometimes makes its home in the {copperhead.Environment}");
        }
예제 #8
0
        static void Main(string[] args)
        {
            Animal       animal   = new Animal();
            Vertebrate   vert     = new Vertebrate();
            Invertebrate invert   = new Invertebrate();
            WarmBlooded  warm     = new WarmBlooded();
            ColdBlooded  cold     = new ColdBlooded();
            JointedLegs  joint    = new JointedLegs();
            WithoutLegs  without  = new WithoutLegs();
            Mammals      bear     = new Mammals();
            Bird         eagle    = new Bird();
            Fish         guppy    = new Fish();
            Reptile      snake    = new Reptile();
            Amphibian    frog     = new Amphibian();
            Platypus     platypus = new Platypus();
            // Console.WriteLine(platypus.layEggBeakVenom());

            Penguin pinguin = new Penguin();



            Amphibian theFrogPrince = new Amphibian();

            Console.WriteLine(theFrogPrince.croak());
            Console.WriteLine(theFrogPrince.talk());

            Bird parrot = new Bird();

            Console.WriteLine(parrot.talk());

            Console.WriteLine("Hello World!");
        }
예제 #9
0
        static void Main(string[] args)
        {
            Bird objectOfBird = new Bird();

            objectOfBird.haveFeathers = true;
            objectOfBird.haveWings    = true;
            objectOfBird.haveWings    = true;
            objectOfBird.canFly       = true;


            Reptile objectOfReptile = new Reptile();

            objectOfReptile.eyesColor = "yellow";
            objectOfReptile.lookCute  = true;
            objectOfReptile.dangerous = true;


            var myAnimals = new Bird[] { objectOfBird };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine("Bird have eggs =" + animal.haveEggs); // is this false because i didn't assignied any value
                Console.WriteLine("Bird have feather =" + animal.haveFeathers);
                Console.WriteLine("Bird have wings =" + animal.haveWings);
            }
        }
예제 #10
0
        static void Main(string[] args)
        {
            var myBird = new Bird();

            myBird.WingColor = "blue";
            myBird.CanFly    = true;
            myBird.HasBeak   = true;
            myBird.TalkBack  = false;

            // Create a class Reptile
            // give this class 4 members that are specific to Reptile
            // Set this class to inherit from your Animal Class
            var myReptile = new Reptile()
            {
                IsColdBlooded = true,
                IsScaly       = true,
                Habitat       = "Swamp",
                CanGrowTail   = true
            };


            var myAnimals = new Animal[] { myBird, myReptile };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Tested:{animal.Tested}");
                Console.WriteLine($"Age:{animal.Age} years old");
                Console.WriteLine($"Color:{animal.Color}");
                Console.WriteLine($"It has {animal.LegCount} legs");
                Console.WriteLine();
            }
        }
예제 #11
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes
            // Create a class Animal
            // Create a class Bird
            // Create a class Reptile

            /*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 bird = new Bird();

            bird.Feathers = "Brown";
            bird.Wings    = "Large";
            bird.Beak     = "Sharp";
            bird.Call     = "Shrieks";
            Console.WriteLine($"This bird is {bird.Feathers} with {bird.Wings} wings, a {bird.Beak} beak, and {bird.Call}! ");


            /*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 reptile = new Reptile();

            reptile.Scales      = "Horny";
            reptile.Eggs        = "Twenty or more";
            reptile.Shell       = "No";
            reptile.ColdBlooded = "Yes";
            Console.WriteLine("Characteristics of an alligator:");
            Console.WriteLine($"Scales: {reptile.Scales} Eggs: {reptile.Eggs} Shell: {reptile.Shell} ColdBlooded: {reptile.ColdBlooded} ");
        }
예제 #12
0
        static void Main(string[] args)
        {
            var robin = new Bird();
            var snake = new Reptile();

            Console.WriteLine(robin.Display());
            Console.WriteLine(snake.Display());
            // 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
             */

            /*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
             */
        }
예제 #13
0
        static void Main(string[] args)
        {
            //Create an object of your Bird class
            Bird traits = new Bird();

            // Give values to your members using the object of your Bird class
            traits.Wings       = "Some birds are feathered and others are not.";
            traits.Bill        = "Birds have different sizes/types of bills.";
            traits.WarmBlooded = "All birds are warm-blooded, even penquins.";
            traits.Bipedal     = "All birds have 2 legs used for perching, walking, hopping or running.";

            // Creatively display the class member values
            Console.WriteLine($"Birds are amazing. {traits.Wings} {traits.Bill} {traits.WarmBlooded} {traits.Bipedal}\n");

            // Create an object of your Reptile class
            Reptile characteristics = new Reptile();

            // Give values to your members using the object of your Bird class

            characteristics.Oviparous   = "All reptiles lay eggs";
            characteristics.ColdBlooded =
                "Most reptiles are cold-blooded vertebrates. They do not have the psychological means of regulating " +
                "their body temperatures and have to depend on the external environment.";
            characteristics.Lungs =
                "Reptiles breathe through their lungs. Although turtles have permeable skin through which gaseous exchange " +
                "takes place while some species increase the rate of gaseous exchange " +
                "through the cloaca, the breathing process can only be completed through the lungs";
            characteristics.Scales =
                "One of the major distinguishing factors between reptiles and other animal classes is the " +
                "presence of scutes or scales.";

            // Creatively display the class member values
            Console.WriteLine($"The amazing Reptile. {characteristics.Oviparous} {characteristics.ColdBlooded} {characteristics.Lungs} {characteristics.Scales}");
        }
예제 #14
0
        static void Main(string[] args)
        {
            /*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 */

            Bird doveBird = new Bird()
            {
                Name        = "ArialBek",
                HasWings    = true,
                HasBackBone = true,
                HasFeathers = true,
                Type        = "electric",
            };

            Console.WriteLine();
            Console.WriteLine($"{doveBird.Name} has {doveBird.Legs} legs! It has wings? {doveBird.HasWings}. It also has backbone? {doveBird.HasBackBone}.");


            /*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 dragonFly = new Reptile()
            {
                Name          = "Angelfish",
                HasScales     = true,
                IsColdBlooded = true,
                LayEggs       = true,
            };

            Console.WriteLine();
            Console.WriteLine($"{dragonFly.Name} which is {dragonFly.Age } years old has no scales on its body, true or false? {dragonFly.HasScales} ! It's a cold blooded animal, true or false? {dragonFly.IsColdBlooded}.");
        }
예제 #15
0
        static void Main(string[] args)
        {
            var myBird = new Bird();

            myBird.HasBeak      = true;
            myBird.HasFeathers  = true;
            myBird.FeatherColor = "Blue";
            myBird.LaysEggs     = true;



            var Lizard = new Reptile()
            {
                IsUgly          = true,
                IsColdBlooded   = true,
                HasScales       = true,
                NumberofSpecies = 10
            };


            var myAnimals = new Animal[] { myBird, Lizard };

            foreach (var Animal in myAnimals)
            {
                Console.WriteLine($"Alive:{Animal.IsAlive}");
                Console.WriteLine($"Age:{Animal.Age}");
                Console.WriteLine($"It has {Animal.NumberOfLegs} legs.");
                Console.WriteLine($"It lives by {Animal.LandSeaAir}.");
            }
        }
예제 #16
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // 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
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */

            /*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 baldeagle = new Bird();

            baldeagle.HasTalons    = true;
            baldeagle.LaysEggs     = true;
            baldeagle.DoesFly      = true;
            baldeagle.WarmBlooded  = "Yes";
            baldeagle.NumberOfLegs = 2;
            baldeagle.Color        = "Brown";

            Console.WriteLine($"The Bald Eagle has {baldeagle.NumberOfLegs} legs and has a {baldeagle.Color} hue.");
            Console.WriteLine($"Does the bird have talons?  {baldeagle.HasTalons}");
            Console.WriteLine($"Does the bird fly?  {baldeagle.DoesFly}");
            Console.WriteLine($"Does the bird lay eggs?  {baldeagle.LaysEggs}");

            Console.WriteLine("");

            var komododragon = new Reptile();

            komododragon.HasTail      = true;
            komododragon.HasTeeth     = true;
            komododragon.NumberOfLegs = 4;
            komododragon.LandAnimal   = "Yes";
            komododragon.WarmBlooded  = "No";

            Console.WriteLine($"The Komodo Dragon has a {komododragon.NumberOfLegs} legs.");
            Console.WriteLine($"Does the Komodo Dragon have teeth?  {komododragon.HasTeeth}");
            Console.WriteLine($"Does is the Komodo Dragon Warm Blooded ?  {komododragon.WarmBlooded}");
            Console.WriteLine($"Does the have a tail?  {komododragon.HasTail}");
        }
예제 #17
0
        static void Main(string[] args)
        {
            // DONE 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



            var myBird = new Bird();

            myBird.FeatherColor = "blue";
            myBird.CanFly       = true;
            myBird.DoMigrate    = true;
            myBird.IsAlive      = true;



            var myReptile = new Reptile()
            {
                IsColdBlooded = true,
                MakesNoise    = true,
                IsScaley      = true,
                Habitat       = "swamp"
            };

            var myAnimals = new Animal[] { myBird, myReptile };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Alive:{animal.IsAlive}");
                Console.WriteLine($"Age:{animal.Age} years old");
                Console.WriteLine($"It has {animal.LegCount} legs");
                Console.WriteLine($"It lives by {animal.LandSeaAir}");
            }



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

            /*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
             */
        }
예제 #18
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // 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- DONE
             *
             * Creatively display the class member values - DONE
             */

            var bigBird = new Bird();
            {
                bigBird.CanFly   = true;
                bigBird.Talons   = 2;
                bigBird.WingSpan = 7.3;
                bigBird.Color    = "brown";

                /*Create an object of your Reptile class- DONE
                 *  give values to your members using the object of your Bird class- DONE
                 *
                 * Creatively display the class member values- DONE
                 */
                var snake = new Reptile()
                {
                    HasScales       = true,
                    Dwelling        = "grass",
                    Size            = 7.5,
                    SwallowsRodents = true
                };

                var theseAnimals = new Animal[] { bigBird, snake };
                foreach (var animal in theseAnimals)
                {
                    Console.WriteLine($"Is alive: {animal.IsAlive}");
                    Console.WriteLine($"Age: {animal.Age} years old");
                    Console.WriteLine($"It has {animal.LegCount} legs");
                    Console.WriteLine($"It lives on the {animal.Habitat}");
                }
                //Console.WriteLine(snake.Habitat);
                //Console.WriteLine(snake.HasScales);
                //Console.WriteLine(snake.SwallowsRodents);
                //Console.WriteLine(snake.LegCount);
            }
        }
예제 #19
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
             */

            /*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 parrot = new Bird();

            parrot.Beak         = true;
            parrot.CanFly       = true;
            parrot.FeatherColor = "purple and blue";
            parrot.Speak        = "Hello! Give me a cracker!";

            Console.WriteLine($"Does it have a beak?: {parrot.Beak}");
            Console.WriteLine($"Can it fly?: {parrot.CanFly}");
            Console.WriteLine($"Can reproduce?: {parrot.Reproduce}");
            Console.WriteLine($"Its feathers are {parrot.FeatherColor}, it is {parrot.Age} years old, and it likes to shout ");
            Console.WriteLine($"'{parrot.Speak}'. It must be a parrot!");
            Console.WriteLine();

            var komodoDragon = new Reptile()
            {
                ColdBlood = true,
                Color     = "green and brown",
                Scales    = true,
                Tail      = true,
            }; //this is an example of where we use commas and semicolon after curly brace.. I still don't understand this well

            Console.WriteLine($"Cold blooded?: {komodoDragon.ColdBlood}");
            Console.WriteLine($"Scales?: {komodoDragon.Scales}");
            Console.WriteLine($"Tail?: {komodoDragon.Tail}");
            Console.WriteLine($"Can reproduce?: {komodoDragon.Reproduce}");
            Console.WriteLine($"Came across a komodo dragon today. A huge lizard which likes to {komodoDragon.ModeOfMove} around. It is also {komodoDragon.Color}.");
        }
        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
             */
            Bird bird = new Bird();

            bird.Name      = "Hawk";
            bird.BeakType  = "Hooked";
            bird.FoodType  = "Carnivore";
            bird.DoesItFly = "Yes";
            bird.Color     = "Red";
            bird.HowFood   = "Hunts";
            bird.Region    = "Southwest";
            bird.Speed     = 150;

            Console.WriteLine($"The {bird.Color} {bird.Name} is a {bird.FoodType} who {bird.HowFood} its food with its {bird.BeakType}.\n " +
                              $"It is from the {bird.Region}. Is this bird able to fly: {bird.DoesItFly}. The {bird.Name} is able fly at {bird.Speed} MPH.");


            /*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 reptile = new Reptile();

            reptile.Name            = "Alligator";
            reptile.Region          = "South";
            reptile.FoodType        = "Carnivore";
            reptile.DoesItHaveClaws = "Yes";
            reptile.Legs            = 4;
            reptile.IsItFast        = "Yes";
            reptile.Color           = "Green";
            reptile.DoesItSwim      = "Yes";

            Console.WriteLine($"The {reptile.Name} is a {reptile.Color} {reptile.FoodType} who is from the {reptile.Region}. It has {reptile.Legs}, {reptile.DoesItHaveClaws} to claws!\n " +
                              $"{reptile.DoesItSwim} it does swim. {reptile.IsItFast} it is fast.");
        }
예제 #21
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



            /*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 myBird = new Bird();

            myBird.Color     = "yellow";
            myBird.DoesItFly = true;
            myBird.Fur       = false;
            myBird.Legs      = 2;
            myBird.Outdoors  = true;
            myBird.Region    = "Northern Midwest";
            myBird.Size      = 6;
            myBird.Sound     = "Tweet Tweet";

            Console.WriteLine($"The bird i see in my backyard is {myBird.Color}. I believe its {myBird.DoesItFly} it can fly faster than the others.");
            Console.WriteLine($"This bird has {myBird.Legs} short legs, and I belive it is from the {myBird.Region}. In size, they average {myBird.Size} inches");
            Console.WriteLine($"Listen, can you here it? {myBird.Sound}!");

            /*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 myRep = new Reptile();

            myRep.Color    = "green";
            myRep.Fly      = false;
            myRep.Fur      = false;
            myRep.Legs     = 4;
            myRep.Outdoors = true;
            myRep.Pet      = false;
            myRep.Sound    = "Burp";
            Console.WriteLine("");
            Console.WriteLine($"Look at this {myRep.Color} lizard I found. You would be {myRep.Outdoors} if you think its a good thing to let him indoors.");
            Console.WriteLine($"Although he has {myRep.Legs} legs, he prefers to walk on 2. He's pretty weird.");
            Console.WriteLine($"All he says is, {myRep.Sound}. See what I mean?");
        }
예제 #22
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

            // 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
             *  give values to your members using the object of your Bird class
             *
             * Creatively display the class member values
             */

            var myBird = new Bird();

            myBird.Feathers   = "Purple";
            myBird.Wings      = "Strong";
            myBird.BeakLength = 3;
            myBird.AreTalons  = true;



            /*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 Aligator = new Reptile();

            Aligator.Habitat = "Swampy";
            Aligator.Scales  = "Green";
            Aligator.Weight  = 987;
            Aligator.Eggs    = "Large";

            var myAnimals = new Animal[] { myBird, Aligator };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Fur is {animal.FurColor}");
                Console.WriteLine($"It has paws: {animal.Paws}");
                Console.WriteLine($"It has whiskers: {animal.AreWhiskers}");
                Console.WriteLine($"Tail:{animal.Tail}");
                Console.WriteLine($"");
            }
        }
예제 #23
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

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


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

            // Done Create a class Reptile
            // give this class 4 members that are specific to Reptile
            // Set this class to inherit from your Animal Class
            var allAnimals = new Animal();



            /*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
             */
            // . notation
            var aBird = new Bird();

            aBird.isAlive   = true;
            aBird.isNamed   = "Florence";
            aBird.AnmlType  = "Flamingo";
            aBird.cute1to10 = 10;

            //accesinmg a function in the animal class
            aBird.PrintMe();


            /*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
             */
            // object initializer syntax
            var aReptile = new Reptile();

            aReptile.isAlive   = true;
            aReptile.isNamed   = "Jerry";
            aReptile.AnmlType  = "Geckko";
            aReptile.cute1to10 = 10;
            //printing to console accessing PrintMe() from the
            //Animal class
            aReptile.PrintMe();

            //isAlive = true,
            //ColdBlooded = true,
            //Habitat = "desert",
            //cute1to10 = 1
        }
예제 #24
0
        static void Main(string[] args)
        {
            var myBird = new Bird();

            myBird.animalName = "Eagle";
            myBird.animalAge  = 5;
            myBird.animalType = "Bird";
            myBird.color      = "Black and White";

            Console.WriteLine("----- Bird Information -----");
            Console.WriteLine($"Animal Name: {myBird.animalName}");
            Console.WriteLine($"Type: {myBird.animalType}");
            Console.WriteLine($"Age: {myBird.animalAge}");
            Console.WriteLine($"Color: {myBird.color}");

            var myReptile = new Reptile();

            myReptile.animalType = "Cold Blood";
            myReptile.animalAge  = 7;
            myReptile.animalName = "Reptile";
            myReptile.color      = "Different colors";
            Console.WriteLine();

            Console.WriteLine("----- Reptile Information -----");
            Console.WriteLine($"Animal Type: {myReptile.animalName}");
            Console.WriteLine($"Type: {myReptile.animalType}");
            Console.WriteLine($"Age: {myReptile.animalAge}");
            Console.WriteLine($"Color: {myReptile.color}");
            // 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
             */

            /*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
             */
        }
예제 #25
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

            var myBird = new Bird();

            myBird.WingColor   = "blue";
            myBird.CanFly      = true;
            myBird.WillMigrate = true;
            myBird.BeakLength  = 3.5;

            Console.WriteLine($"My bird has {myBird.WingColor} colored wings.\n" +
                              $"If you are wondering if my bird is able to fly and/or will migrate, the answers are {myBird.CanFly} and {myBird.WillMigrate}!\n" +
                              $"The length of my bird's beak is {myBird.BeakLength} inches.\n");


            var lizard = new Reptile()
            {
                IsColdBlooded = true,
                IsScaly       = true,
                Habitat       = "swamp",
                CanGrowTail   = true
            };

            Console.WriteLine($"Our lizard's habitat is in the {lizard.Habitat}.\n" +
                              $"You are probably wondering a few other attributes about our lizard. \n" +
                              $"Is our lizard cold blooded? {lizard.IsColdBlooded}\n" +
                              $"Is our lizard scaly? {lizard.IsScaly}\n" +
                              $"Can our lizard grow a tail? {lizard.CanGrowTail}\n"
                              );


            /*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
             */

            /*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
             */
        }
예제 #26
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



            /*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 myBird = new Bird();

            myBird.WingColor  = "blue";
            myBird.BirdFlies  = true;
            myBird.Migrates   = true;
            myBird.BeakLength = 3.5;

            /*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 myReptile = new Reptile();
            {
                myReptile.Habitat    = "water and land";
                myReptile.HasScales  = true;
                myReptile.IsVenomous = false;
                myReptile.IsCarnivor = false;
            }

            var myAnimals = new Animal[] { myBird, myReptile };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"{animal.IsAlive}");
                Console.WriteLine($"Age: {animal.Age}");
                Console.WriteLine($"It has {animal.LegCount} legs");
                Console.WriteLine($"It lives by {animal.LandSeaAir}");
                Console.WriteLine($"");
            }
        }
예제 #27
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
             */

            /*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
             */

            Bird Owl = new Bird();

            Owl.Legs         = 2;
            Owl.Predatory    = true;
            Owl.Name         = "Barn Owl";
            Owl.Size         = "pretty big";
            Owl.Wingspan     = 230;
            Owl.Flightless   = false;
            Owl.Domesticated = false;
            Owl.Eats         = "small rodents";

            Console.WriteLine($"I'd love to tell you about my favorite bird! Its a {Owl.Name}! They arent the biggest of the owls but they are {Owl.Size}, their general wingspan is about {Owl.Wingspan}cm." +
                              $"They usually eat {Owl.Eats}, and dont mistake these things for penguins because assuming they are flighless would be {Owl.Domesticated}," +
                              $" however, to assume that they are predatory would be {Owl.Predatory}. And is most cases we can generally say that a barn owl being Domesticated is {Owl.Domesticated}." +
                              $"Another interesting thing about owls is that they have {Owl.Legs} legs, that are suprisingly long!");

            Reptile gecko = new Reptile();

            gecko.RepCon(4, "insects", "leopard gecko", true, true, true, false, 110);
            Console.WriteLine($"Now, on to my favorite reptile! The {gecko.Name}, these interesting little guys cant just save you a ton on your car insurance! " +
                              $"Did you know that they have {gecko.Legs} legs, and a tail which can all regrow if lost to a predator or injury!  " +
                              $"It is {gecko.MoltsToGrow} that geckos do occasionally shed their skin, and it is also {gecko.Domesticated} that geckos are domesticated! " +
                              $"Though if you are afraid of bugs you may want to steer clear as the main diet of a gecko consists of {gecko.Eats}, and incredibly these little guys have {gecko.Teeth} teeth!" +
                              $"Its also {gecko.Amphibious} that these little guys can live and breathe in water for a time, while for most species it is {gecko.Poisonous} that they are poisonous");
        }
예제 #28
0
        static void Main(string[] args)
        {
            // TODO Be sure to follow best practice when creating your classes

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


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

            // Create a class Reptile-DONE
            // 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
             */
            Bird bird1 = new Bird()
            {
                HasFeathers  = true,
                CanFly       = true,
                CanSing      = true,
                EatsCrackers = true,
                Name         = "Polly"
            };



            /*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 snake = new Reptile()
            {
                Legs          = 0,
                CanSwim       = true,
                IsColdBlooded = true,
                Moves         = "slithers",
                Name          = "Mr. Slithers"
            };

            bird1.PrintDetails();
            snake.PrintDetails();

            Bird penguin = new Bird(2, true, true, true, false, false, false, false, "Squeaky");

            penguin.PrintDetails();
        }
예제 #29
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 myBird = new Bird();

            myBird.IsBirdAlive = true;
            myBird.CanFly      = true;
            myBird.BirdColor   = "yellow";
            myBird.CanTalk     = true;

            /*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 myReptile = new Reptile();

            myReptile.IsColdBlooded = true;
            myReptile.LaysEggs      = true;
            myReptile.RepColor      = "black";
            myReptile.RepAge        = 3;

            var myAnimals = new Animal[] { myBird, myReptile };

            foreach (var animal in myAnimals)
            {
                Console.WriteLine($"Age: {animal.Age}");
                Console.WriteLine($"Number of Legs: {animal.NumOfLegs}");
                Console.WriteLine($"Color: {animal.Color}");
                Console.WriteLine($"IsAlive: {animal.IsAlive}");
                Console.WriteLine($"");
            }
        }
예제 #30
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
            // DONE


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

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

            /*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
             */
            /*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
             */
            //DONE - SEE BELOW
            var blueJay = new Bird("Blue Jay", false, "tweet!", true);

            Console.WriteLine(blueJay.Sing());
            Console.WriteLine(blueJay.Fly());
            Console.WriteLine(blueJay.Consume("seeds"));
            Console.WriteLine(blueJay.Reproduce());
            var penguin = new Bird("Penguin", false, "Sqwak!", false);

            Console.WriteLine("Penguin is trying to fly..");
            Console.WriteLine(penguin.Fly());
            var rattlesnake = new Reptile("Rattlesnake", true, "hisss!", 0, false);

            Console.WriteLine(rattlesnake.Slither());
            Console.WriteLine(rattlesnake.Sunbathe());
            Console.WriteLine(rattlesnake.Noise);
            var turtle = new Reptile("Turtle", false, "gulp", 4, true);

            Console.WriteLine("Turtle trying to eat meat...");
            Console.WriteLine(turtle.Consume("meat"));
            Console.WriteLine("Turtle trying to slither...");
            Console.WriteLine(turtle.Slither());
            Console.WriteLine($"The Turtle can swim: {turtle.Swimming}");
            var squirrel = new Animal("Squirrel", "Ththttht");

            Console.WriteLine(squirrel.Reproduce());
        }