Question: 1 . Your code will read the names of several animals ( maximum 2 0 ) from a given file named animals.txt 2 . Upon

1. Your code will read the names of several animals (maximum 20) from a given file named
animals.txt
2. 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.
3. 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 5-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 4 because you need to be mindful of the cost of feeding them. The number of instances must be generated randomly.
4. For each identifiable resident animal, you must assign an age chosen randomly between 1 and 20(inclusive) years.
5. For each identifiable resident animal, you must assign an initial weight chosen randomly between 2.5 kg and 30.5 kg (inclusive).
6. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!