Question
This week's assignment is called Animal Farm. Write a C# program which... Presents a menu to the user The menu allows the user to Enter
This week's assignment is called Animal Farm. Write a C# program which... Presents a menu to the user The menu allows the user to Enter an animal Have all animals speak Exit If the user selects enter an animal, a new menu is presented Enter a Dog Enter a Cat Enter a Pig Enter a Cow Regardless of what type of animal the user picks, the next step will be to prompt the user to enter the animal's name. If the user selects "have all animals speak", a list of all the animals, their names, and the appropriate speech for the type of animal they are shall be presented. For example: The dog Rover barks The cat Fluffy meows The dog Spot barks The pig Wilbur oinks The cow Bessie moos The menu, animal entry, and animal speaking shall continue until the user selects exit. Internal requirements The various animals entered by the user must be stored in an array of type Animal (Meaning, you have to use polymorphism!) You may limit the user to entering no more than 100 animals. ie, the maximum array size. You must create a class Animal Class animal shall be abstract Animal shall have a name attribute Animal shall have an abstract method void Speak(); You must create Dog, Cat, Pig, and Cow child classes of Animal These child classes shall override the Speak() method appropriately.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started