Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Reptile dragonlLizard = new Reptile("Dracos", 100, 100, "china", true, true);
            Mammal  platypus      = new Mammal("Joke", 50, 100, "??", false, true);

            dragonlLizard.GetInfo();
            platypus.GetInfo();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Reptile DragonLizard = new Reptile(14.0, 72.6, "Herman", "Spain", true);
            Mammal  Bear         = new Mammal(96.4, 480.2, "Smoky", "Montana", true);

            DragonLizard.GetInfo();
            Bear.GetInfo();

            Console.WriteLine(DragonLizard.Sum());
            Console.WriteLine(Bear.Sum());

            Console.WriteLine(DragonLizard.GetWeight(50));
            Console.WriteLine(Bear.GetWeight(100));
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("What species is your animal? \n"
                              +
                              "1 - Bird \n" +
                              "2 - Reptile");
            int specAnswer = int.Parse(Console.ReadLine());

            if (specAnswer == 1)
            {
                Bird birdObj = new Bird();
                Console.WriteLine("What is the Name Of the Animal?");
                var name = Console.ReadLine();
                birdObj.Name = name;
                Console.WriteLine($"Can {name} flys? \n" +
                                  $"1 - Yes \n" +
                                  $"2 - No");
                int  flyOrNot = int.Parse(Console.ReadLine());
                bool mvnt;
                if (flyOrNot == 1)
                {
                    mvnt = true;
                }
                else
                {
                    mvnt = false;
                }
                birdObj.CanFly = mvnt;
                Console.WriteLine($"Skin type of {name}?");
                var skin = Console.ReadLine();
                birdObj.SkinType = skin;
                Console.WriteLine($"{birdObj.Name} is a {birdObj.Species}, which has {birdObj.Eyes} eyes, {birdObj.SkinType} for skin. You may ask yourself can {birdObj.Name} fly? {birdObj.CanFly} ");
            }
            if (specAnswer == 2)
            {
                Reptile reptileObj = new Reptile();

                Console.WriteLine("What is the Name Of the Animal?");
                var name = Console.ReadLine();
                reptileObj.Name = name;
                Console.WriteLine($"How Does {name} get around?");
                var mvnt = Console.ReadLine();
                reptileObj.Mobility = mvnt;
                Console.WriteLine($"Skin type of {name}?");
                var skin = Console.ReadLine();
                reptileObj.SkinType = skin;
                Console.WriteLine($"{reptileObj.Name} is a {reptileObj.Species}, which has {reptileObj.Eyes} eyes, {reptileObj.SkinType} for skin, and travels using {reptileObj.Mobility} ");
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Reptile dragonLizard = new Reptile(140, 226, "Herman", "Spain", true);

            Mammal bear = new Mammal(96.4, 480, "Smoky", "Montana", true);

            Console.WriteLine(bear.Sum());

            dragonLizard.GetInfo();

            Mammal wildCat = new Mammal(74, 193, "Willy", "Kansas State", true);

            wildCat.GetInfo();

            Console.WriteLine();

            Console.WriteLine(dragonLizard.GetWeight(0));

            Console.WriteLine(bear.GetWeight(100));
        }