Question: **PYTHON** In this question, we will create a class called Retriever that is a subclass of the Dog class. In addition, the Retriever class will

**PYTHON**

In this question, we will create a class called Retriever that is a subclass of the Dog class. In addition, the Retriever class will have a member variable called age (integer) that designates the retriever's age. Make sure to use the Dog class's __init__ function to initialize the Retriever object for the name and breedmember variables. Note: Pass in the string retriever as the breed parameter for the Dog's init function. The Retriever class will support a similar function: get_age that simply returns the age member variable of the Retriever class. In addition, it will support one additional function: get_human_age that returns an integer based on the age of the Retriever. The conversion rate from retriever years to human years is that 1 retriever year = 7 human years. Therefore a retriever that is 3 years old is 21 years old in human years.

class Retriever(Dog): ''' Represents a Retriever Attributes ---------- name: A string representing the Retriever object's name breed: A string designating the Retriever object's breed Methods ------- __init__: Initializes the Retriever object. get_age: returns age attribute of Retriever object get_human_age: converts the retriever object's dog years into human years ''' def __init__(self, age, name): ''' Initializes the Retriever class. Parameters ---------------- age: An integer representing the Retriever object's age name: A string representing the Retriever object's name Attributes ---------- Retriever.age (int): set to `age`. Retriever.name (str): set to `name`. ''' # YOUR CODE HERE def get_age(self): ''' Retrieves the age attribute of the Retriever object.

Returns ------- Integer. age attribute. ''' # YOUR CODE HERE def get_human_age(self): ''' Returns an integer representing speed based on follow condition: 1 retriever year = 7 human years

Returns ------- Integer ''' # YOUR CODE HERE

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!