Answer:
class Pet():
def __init__(self, name, age, weight, animal_type, breed):
self.name = name
self.age = age
self.weight = weight
slef.aT = animal_type
self.breed = breed
def set_name(self, name):
self.name = name
def get_name(self):
return self.name
def set_age(self, age):
self.age = age
def get_age(self):
return self.age
def set_weight(self, weight):
self.weight = weight
def get_weight(self):
return self.weight
def set_Type(self, type):
self.aT = type
def get_Type(self):
return self.aT
def set_breed(self, breed):
self.breed = breed
def get_breed(self):
return self.breed
def toString(self):
print(f"The pet {self.name} is {self.age} year old and weighs {self.weight}lbs. The pet is a {self.breed} breed of {self.aT}.")
Step-by-step explanation:
The python program defines a class called Pet that has five features namely name, age, weight, animal_type, and breed of the animal. The set and get methods of the class are the mutators and accessor respectively. The final method of the class is the 'toString' method that prints the summary of the Pet object instance.