Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Your code will read the names of several animals ( maximum 2 0 ) from a given file named animals.txt 2 . Upon
Your code will read the names of several animals maximum from a given file named
animals.txt
Upon successfully reading the file, your code will generate another file to be written to disk. For each animal listed in animals.txt you will generate a number of such animals as residents of the simulated zoo. You will name the file, residents.txt
There must be one or more residents of the same animal type. For example, if you read Tiger from animals.txt you must create multiple instances of Tiger and identify each one by a letter nickname generated randomly. The first letter of the nickname must be capitalised and the second letter cannot be the same as the first letter. Limit the number of instances of an animal to no more than because you need to be mindful of the cost of feeding them. The number of instances must be generated randomly.
For each identifiable resident animal, you must assign an age chosen randomly between and inclusive years.
For each identifiable resident animal, you must assign an initial weight chosen randomly between kg and kg inclusive
For each identifiable resident animal, you must assign a gender chosen randomly as either female or male.
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