Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Update the terrorize _ town ( ) methods Update the terrorize _ town ( ) method in all three Monster classes ( Monster , Mutant,
Update the terrorizetown methods
Update the terrorizetown method in all three Monster classes Monster Mutant, and Vampire
The value for population, buildings, and stoplights should never be allowed to go below zero.
Update the Mutant Class
Add an additional method to the Mutant class called rampage The new method takes two arguments: self and a list of Town objects. It will return a list of Town objects.
In the logic of the method, execute the Mutant objects terrorizetown method on each Town in the list of towns.
The method should also create a new list of Town objects that stores each Towns state after they have been terrorized. The method will return that list of updated Towns.
Update the index.py
Comment out all of the existing logic from the main method in your index.py file.
Create a new instance of the Mutant class and provide a name, height, and weight of your choice.
Create a list of strings. Each string will hold the name of a town. Use any town names you like.
For each town name in your list, instantiate a new object of class Town.
The string value from the list will be the Town objects name property.
The Town objects population should be a random integer between
The Town objects buildings should be a random integer between
The Town objects stoplights should be a random integer between
Use the Town objects describetown method to display the towns description to the screen.
Store the newly created Town objects in a new list a list of objects of class Town
Instantiate a new Mutant object.
Now, rampage the towns! Pass the list of towns to the Mutant objects rampage method the one you wrote above Your screen should then display the results of the Mutant objects rampage and show that each Town object has been negatively impacted by the monsters attack.
Finally, write a loop that sends the Mutant on three rampages. Each subsequent rampage should start with the Town objects state after the previous rampage. For example, if Indianapolis starts with a population of then it might have after the first rampage, after the second rampage, and after the third rampage.
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