Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
