Answered step by step
Verified Expert Solution
Question
1 Approved Answer
he next set of question, We will work once more with the Animal and Zoo class. Below is a version of the An: #Example class
he next set of question, We will work once more with the Animal and Zoo class. Below is a version of the An: \#Example class to build off of class Animal (object) : " " " This is an Animal class, used to store information about animals in the Zoo. " " " def init_(self, kind, required_area=0): "" Initialize the Animal object. Inputs are kind: the type of animal (string) required_area: square meters (int) " " " self.kind = kind self.required_area = required_area def set_required_area(self, area): "" " Set area required for a single animal. "" " self.required_area = area def set_kind(self, kind) : "" " Set the kind of the animal " "" self.kind = kind def get_kind(self): " " "' Return animal's kind. " "" return self.kind def get_required_area (self): "" " Return area required for a single animal. "" " return self.required_area Part 2.1.1 Building a Test Animal (3 Points) Before we start making changes to our classes, let's start by creating some test/example instances of them. In the cell below, pick your favorite animal and a fun name and create a new Animal object. Part 2.1.2 Adding in Additional Information (5 Points) Before we can begin building our zoo we need more information about the needs of our animals. Specifically, we need to think about the different habitats the animals live in. We now have that information from your dataframe. For our zoo, we will be building aquatic habitats, grassland habitats, and aviaries. Ultimately, we're going to need to know how big the different habitats will need to be. Extend the class given above to store information to incorporate habitat information in the cell below. Part 2.1.3 Calculating Required Area (10 Points) Now that we have our habitat information, we can use that to calculate the required area. First, we're going to assume that animals living in different habitats require the following amount of area: - aquatic : 10m2 per animal - aviary : 20m2 per animal - grassland : 30m2 per animal In the method, write a piece of code that uses the information above to determine the area required for the animal and set the required_area attribute
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