Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Update the terrorize _ town ( ) methods Update the terrorize _ town ( ) method in all three Monster classes ( Monster , Mutant,

Update the terrorize_town() methods
Update the terrorize_town() 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 terrorize_town() 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 5 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 10,000-50,000
The Town objects buildings should be a random integer between 100-2,000
The Town objects stoplights should be a random integer between 50-1,000
Use the Town objects describe_town() 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 50,000 then it might have 45,000 after the first rampage, 41,000 after the second rampage, and 36,500 after the third rampage.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Outline the employee's role in the succession management process.

Answered: 1 week ago