The Animal class has the following member variables:
Adult if age >= 3 days
Baby if age < 3 days
Tiger cost $10,000
Penguin cost $1,000
Turtle cost $100
Number of Babies
Tigers have 1 baby
Penguins have 5 babies
Turtles have 10 babies
Base Food Cost
You can get this base food cost from the user or set it as aconstant. Example base food cost per animal per day: $10.
Tigers have a feeding cost of 5 times the base cost
Penguins have a feeding cost that is the same as the basecost
Turtles have a feeding cost that is 50% the base cost
A tiger’s payoff per day is 20% of their cost per animal. (notcounting bonus)
A penguin’s payoff per day is 10% of their cost per animal
A turtle’s payoff per day is 5% of their cost per animal
Note: please do not modify the variables names or add moremember variables to this class.
The player begins with a specific amount of money in the bank,e.g. 100,000 dollars. At the start, the user needs to buy threetypes of animals (tigers, penguins, turtles) to start the business.Each type should have a quantity of either 1 or 2. For each animalbought, the cost is subtracted from the bank. All newly boughtanimals are 1 day old.
Each turn is a “day”. At the beginning of the day, all animalsincrease age by 1 day, and the user needs to pay the feeding costof each animal. Feeding is required so the animals don’t die. Afterthe feeding cost is subtracted from the bank, one randomized eventtakes place during the day. You can determine how to implement therandom functions by yourself. The random function will pick onerandom event from the following list:
A sickness occurs to an animal in the zoo:
Pick an animal at random that will die
Remove one animal of that type from the exhibit. (dynamic arrayin the zoo)
A boom in zoo attendance occurs:
Generate a random bonus for the day, 250-500 dollars for eachtiger in the zoo
Add the bonus payoff for each tiger to the total payoff of theday as a reward
A baby animal is born:
Pick an animal at random to have a baby
Check if there is an animal old enough to be a parent (age >=3), add babies to the zoo depending on the “number of babies”specific to the type of animal. If no animal is old enough of therandomly selected type, pick another type of animal. Baby animalsstart at age 0. For simplicity, you don’t need to consider thegender of the adult animals in order to have babies. One adultanimal is good enough to have babies.
Note: If no animals are able to give birth to baby animals inthe zoo, your program needs to be able to recognize this andrecover.
4. Nothing happens
After the random event, calculate the profit for the day basedon the number of each animals and their payoff. If there is a bonusfor the day, add it to the profit as well. Before the day ends, askthe player if they would like to buy an adult animal. If they do,ask for the type of animal they would like, then add the animal tothe zoo and subtract that cost from the bank. The adult animal thatis bought will be 3 days old.
After the end of a day, prompt user whether to keep playing orend the game. If the user has no money, print a message to tell theuser the game is over, and end the game.
The following classes are required: zoo, animal, tiger, penguin,and turtle. The program also must use inheritance; the tiger,penguin, and turtle class must inherit from animal class.
Also, the zoo class should have a dynamic array for each type ofanimal. Each dynamic array should have a capacity of 10 animals tostart with. If more animals are added, you should resize thedynamic array by doubling the starting capacity to hold moreanimals.
Make sure to check for incorrect data types entered by the userand continue to re-prompt for input until valid input isreceived.
New Animal: (5pts)
Add a new class for your new animal. It should also inherit fromthe Animal class. This should also allow the user to dynamicallycreate a new animal during runtime, re-prompting them for eachtrait.
Status messages: (5pts)
Put a message into a text file for each random event. Forexample, during a boom in zoo attendance, print:
“Today is National Tiger Day! Tigers generate money today! Youmade: 360 extra dollars for each tiger you own!”
Use ifstream to read messages from the created text file.
Different Feed Types: (5pts)
Allow user to pick between 3 different types of feed at thestart of each day.
Cheap: Half as expensive for all animals, sickness becomes twiceas likely to occur.
Generic: behaves normally.
Premium: Twice as expensive for all animals, sickness becomeshalf as likely to occur.
The post Zoo Tycoon Requirements Animal Class Animal Class Following Member Variables Age Adult Age Q28563724 appeared first on Nurses Den.