Exemple #1
0
        static void Main(string[] args)
        {
            Horse Horsey = new Horse();

            Horsey.Speak("Horsey");
            Horsey.Eat();
            Horsey.Move();
            Horsey.Produce();
            Horsey.Food();

            Chicken Chickie = new Chicken();

            Chickie.Speak("Chickie");
            Chickie.Eat();
            Chickie.Move();
            Chickie.Produce();
            Chickie.Food();

            Cow Cowie = new Cow();

            Cowie.Speak("Cowie");
            Cowie.Eat();
            Cowie.Move();
            Cowie.Produce();
            Cowie.Food();

            Pig Piggie = new Pig();

            Piggie.Speak("Piggie");
            Piggie.Eat();
            Piggie.Move();
            Piggie.Produce();
            Piggie.Food();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Horse horse = new Horse("MrErd");

            horse.Speak();
            horse.product();
            horse.House();
            horse.eat();

            Console.Write("\n");

            Cows cow = new Cows("cow", "moo");

            cow.speak();
            cow.product();
            cow.House();
            cow.eat();


            Console.Write("\n");


            Goat goat = new Goat("goat", "bleat");

            goat.speak();
            goat.product();
            goat.House();
            goat.eat();


            Console.Write("\n");


            Dog dog = new Dog("dog", "bark");

            dog.speak();
            dog.product();
            dog.House();
            dog.eat();
        }
Exemple #3
0
        private static void Menu2(int menu)
        {
            int menu2 = Convert.ToInt32(Console.ReadLine());

            if (menu2 == 1)
            {
                Horse horse1 = new Horse();
                horse1.Speak();
                Animal1();
                Menu2(menu);
            }
            else if (menu2 == 2)
            {
                Horse horse1 = new Horse();
                horse1.Eat();
                Animal1();
                Menu2(menu);
            }
            else if (menu2 == 3)
            {
                Horse horse1 = new Horse();
                horse1.Run();
                Animal1();
                Menu2(menu);
            }
            else if (menu2 == 4)
            {
                Horse horse1 = new Horse();
                horse1.Attack();
                Animal1();
                Menu2(menu);
            }
            else
            {
                Menu();
            }
        }
        static void Main(string[] args)
        {
            var horse = new Horse()
            {
                AnimalName = "Horse",
                Sound      = "NEIGH!!!",
                Speed      = 55,
                JumpHeight = 5
            };

            horse.Speak();
            horse.Noise();
            horse.Run();
            horse.Jump();

            Console.ReadLine();
            Console.Clear();

            var cow = new Cow()
            {
                AnimalName = "Cow",
                Sound      = "MOO!!!",
                Food       = "Grass",
                MeatAmount = 500,
            };

            cow.Speak();
            cow.Noise();
            cow.Eat();
            cow.SlaughterHouse();

            Console.ReadLine();
            Console.Clear();

            var turkey = new Turkey()
            {
                AnimalName = "Turkey",
                Sound      = "GOBBLE! GOBBLE!",
                Food       = "Corn",
                Holiday    = "Thanksgiving"
            };

            turkey.Speak();
            turkey.Noise();
            turkey.Eat();
            turkey.HolidayServed();

            Console.ReadLine();
            Console.Clear();

            var fox = new Fox()
            {
                AnimalName = "Fox",
                Sound      = "........(silent)",
                Food       = "Eggs",
                Smell      = "Chickens",
            };

            fox.Speak();
            fox.Noise();
            fox.Search();
            fox.Eat();


            Console.ReadLine();
        }