1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olganol [36]
3 years ago
7

Create a Pet class that keeps track of the name, age, weight, type of animal, and breed for records at an animal clinic with 2 c

onstructors, accessor (get) methods, a toString method, and mutator (set) methods for each instance variable.
Computers and Technology
1 answer:
kati45 [8]3 years ago
4 0

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}.")

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.

You might be interested in
when an object is passed as a non-reference pointer parametor to a method, modifiying the members of that object from
larisa [96]

Answer:

"this" keyword representing the class object itself.

Explanation:

Object-oriented programming concept emphasizes on using blueprints representing the structure of a data collection type to continuously create an instance of that data structure. The instance of that object is called a class object. It is used in database management systems to populate the database.

Functions defined in the class objects are called methods and are used specifically by the class instance to modify the data content of the class object defined.

When a member of a class is referenced in the class, it can be accessed with the "this" keyword. At an instance of the class object, the variable holding the object should be called to get the class content because of the "this" keyword binding the instance of the object to the method.

6 0
2 years ago
Katie is training for a marathon and wants to run a
Eva8 [605]

Answer: 115 miles a month

Explanation:

460/4

which equals

<em><u>115 miles per month</u></em>

6 0
3 years ago
Accessing calendars, contact information, email, files and folders, instant messaging, presentations, and task lists over the in
Illusion [34]
The answer is Cloud Computing.  It access calendars, contact information, email, files and folders, instant messaging, presentations, and task lists over the internet. This means, if you have a device and an internet connection, you can have your "office" anywhere, anytime.
4 0
2 years ago
Read 2 more answers
Which tool helps a project manager identify the task that have been completed and the ones that are still outstanding
vodka [1.7K]

Answer:

timeline please make me branliest

4 0
2 years ago
A structure, in C, has been given by: struct MYSTRUCT { char buf[15] shorts S int i; } * Select the proper keywords in the prope
vodka [1.7K]

Answer:

MYSTRUCT myStruct[8]; // statemnt to create an array of struct variables

myStruct[3].buf[4] // statement to access the fourth element of the array of the struct variables.

struct * MYSPTR = &myStruct; // This statement creates a pointer.

To dereference and access the S variable of the struct data structure in the array;

(*MYSPTR).S and its shorthand notation MYSPTR -> S

Explanation:

A structure is a data structure in C language that is used to hold descriptive data of an object. The keyword struct is used to create the structure. An array of struct holds instances of a struct variable, where each struct can be accessed using the regular array indexing and the variables of the structs in the array can be accessed using dot notation.

7 0
2 years ago
Other questions:
  • Which of the following correctly orders the investments from LOWER risk to HIGHER risk?
    7·2 answers
  • How is a recession determined?
    10·1 answer
  • A customer in a store is purchasing 5 items. Write a python program that asks for the price of each item and display the subtota
    14·1 answer
  • There is the Iphone MAX, Iphone XR and Iphone XS. which iphone is the very NEWEST and which one do you recommend? explain.
    5·2 answers
  • How can officers in the armed services receive college educations? Select the best answer choice. A. All of the answers are corr
    11·1 answer
  • Dorothy needs to edit JPEG and GIF files in a multimedia application. Which software can Dorothy use to edit these files?
    8·2 answers
  • What is 14.10 to the tenth power​
    14·1 answer
  • Robert is risk manager at TPT Bank has been asked to implement an updated badge reader system for addressing access control risk
    8·1 answer
  • 15 _____ 3 = 0 Question 11 options: a) / b) % c) * d) //
    12·1 answer
  • What is a critical consideration on using cloud-based file sharing and storage applications.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!