Question

In: Computer Science

Scenario Suppose you work for a wildlife conservation organization. You are working on creating a system...

Scenario

Suppose you work for a wildlife conservation organization. You are working on creating a system to educate the general public about different animals and get them more interested in conservation.

Aim

Create a Eagle class that inherits from the Bird class and has a clutch size (eggs laid in one nesting) attribute. Change the behavior of instances of the Eagle class to include this clutch size fact when they're printed.

Steps for Completion

  1. Go to your main.py file.

  2. Define the Eagle class that inherits from the Bird class. Override the __init__ initializer method and add a clutch_size attribute with the value of 3.

  3. Override the __str__ method and modify it to include mention of the clutch size.

  4. At the bottom of the script we have initialized an instance of the Eagle class and called print on the instance, which should display facts about the eagle.

Run the script by using python3 main.py in the terminal. The output should be as shown in Snippet 7.86:

The eagle has a wingspan up to 7.5ft, has a lifespan of 20 years and can fly at a maximum speed of 99mph. It also has a clutch size up to 3.

Solutions

Expert Solution

Program Code Screenshot:

Sample output:

The screenshots are attached below for reference.

Please follow them for proper indentation and output.

Program to copy:

class Bird:#Bird class definition
def __init__(self,h,l,s):#constructor of class
self.height=h
self.span=l
self.speed=s
  
def __str__(self):#string representation of Bird class attributes
return "Height is: "+str(self.height)+" Life span is:"+str(self.span)+" Speed is "+str(self.speed)


class Eagle(Bird):#Eagle class definition
def __init__(self,h,l,s,c):
super().__init__(h,l,s)
self.clutch_size=c

def __str__(self):#string representation of Eagle class attributes
s=super().__str__()
return s+" clutcch size is "+str(self.clutch_size)


e=Eagle(7.5,20,99,3)#create object and print
print(e)


Related Solutions

How is the organization you work for departmentalized? Is it effective? (If you are not working...
How is the organization you work for departmentalized? Is it effective? (If you are not working pick a place you previously worked for)
Suppose that you are creating a website for an organization that wants the site to include...
Suppose that you are creating a website for an organization that wants the site to include a photo gallery containing hundreds of high resolution photographs. What would happen to the page download time if you include all the photographs on one page, in their native size and resolution? What can you do to change the download time of such a page? Please explain your reasoning.
Scenario Your organization is beginning the process of creating an organization-wide strategic plan for the next...
Scenario Your organization is beginning the process of creating an organization-wide strategic plan for the next five years. You are the only managerial accountant in your entire organization. The committee leading the strategic plan efforts does not include you in the planning process because you are "just" an accountant that records information and could not possibly have anything to add to the strategic planning process. Initial response As the managerial accountant, explain to the committee leading the strategic planning process...
Scenario: Imagine that you are working as a mid-level administrator within a healthcare system. You have...
Scenario: Imagine that you are working as a mid-level administrator within a healthcare system. You have been tasked with chairing a strategic planning task force to revise and update the healthcare system’s strategic plan. Your initial task is to call a meeting with your newly created strategic planning task force. Your first item on the agenda is to engage your task force in generating creative approaches to the strategic planning process. Please briefly explain (in a minimum of 250 words)...
You are working on a conservation farm with an endangered species of antelope in central Colorado....
You are working on a conservation farm with an endangered species of antelope in central Colorado. You notice that birth weight of offspring seems to correlate with air temperature, but that the relationship is not as strong in females as in males. You wonder why that could be. a) What is your testable hypothesis? b) Design an experiment to test that hypothesis. c) What is your null hypothesis? d) Describe the type of data you will get from the experiment....
Management Information System This assignment is about creating a blog and a research about working for...
Management Information System This assignment is about creating a blog and a research about working for The Office of Career Services at a school. Answer the following questions based on your team project The Office of Career Services. Pretty much we are making up this job so you can include any vendors and any inter-enterprise. (you can just make-up your own idea or use imagination) . What are CRM, ERP and EAI? Who are the major ERP vendors? Does your...
Suppose you are starting work on a project for an organization that has never used any...
Suppose you are starting work on a project for an organization that has never used any modeling techniques or tools in designing a system. (Yes, it is hard to imagine, but it does exist.) Your manager is reluctant to change from the way they have always done things. Write a one- to two-page issue paper (or a PowerPoint presentation as an alternative) on why systems modeling is worth the time and resources involved. ONE TO TWO PAGE ISSUE PAPER!
Scenario: Suppose you are a risk management professional working for risk managing firm which islocated in...
Scenario: Suppose you are a risk management professional working for risk managing firm which islocated in Dubai. risk managing firm provides consulting services to firms such as airlinecompanies and mining companies on their risk management. Mr. Abdul, the treasurer of goil Pte Ltd, approaches you today (assume it is now July 2020) to ask you for advice onthe financial risk management of his company. Goil (Dubai) Pte Ltd is a trading company which specializes in international trade of petrochemicals and...
Suppose you work in an organization that creates web pages for clients. You have been tasked...
Suppose you work in an organization that creates web pages for clients. You have been tasked with creating a KM program to make the process more efficient. Describe, in detail, how you would measure its effectiveness. Be sure to include examples to support your response.
Scenario # 1 : Wholesome Hamburger Company Suppose you work for the Wholesome Hamburger Company that...
Scenario # 1 : Wholesome Hamburger Company Suppose you work for the Wholesome Hamburger Company that owns a 100 fast food restaurants in California. There is a big drought and people are being told to use less water. You know that it takes: 1,800 gallons of water to produce one pound of beef, 12 gallons of water to produce a head of lettuce, 2 gallons for one walnut, and 468 gallons of water to produce a pound of chicken. You...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT