Pet Class
The Pet class
Write a class named Pet, which should have the following data attributes:
■ _ _ name (for the name of a pet)
■ _ _ animal_type (for the type of animal that a pet is. Example values are 'Dog', 'Cat', and 'Bird’)
■ _ _ age (for the pet’s age)
The Pet class should have an _ _init_ _ method that creates these attributes. It should also have the following methods:
■ set_name
This method assigns a value to the _ _name field.
■ set_animal_type
This method assigns a value to the _ _animal_type field.
■ set_age
This method assigns a value to the _ _age field.
■ get_name
This method returns the value of the _ _name field.
■ get_animal_type
This method returns the value of the _ _animal_type field.
■ get_age
This method returns the value of the _ _age field.
Once you have written the class, write a
stored as the object’s attributes. Use the object's accessor methods to retrieve the pet’s name, type, and age and display this data on the screen.
Learn your wayIncludes step-by-step video
Chapter 10 Solutions
Starting Out with Python (4th Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Mechanics of Materials (10th Edition)
Degarmo's Materials And Processes In Manufacturing
Concepts Of Programming Languages
Java: An Introduction to Problem Solving and Programming (8th Edition)
Modern Database Management
- Given this Hasse diagram, which of the following statements is false? d b g d and a are comparable. a and f are incomparable. d is the only maximal element. a and f are minimal elements.arrow_forwardUsing the Gane and Sarsen's method, draw up a specification document for the Chocoholics Anonymous product described in Appendix A.arrow_forwardYou are asked to explain what a computer virus is and if it can affect computer’shardware or software. How do you protect your computer against virus?arrow_forward
- Discuss the four major computer generations in detail. Please emphasize on theirfeatures and examples of computers in each of the generations. Give one reference.arrow_forwardDiscuss with appropriate scenarios several ways by which it has affected education and learningnegatively and positively.arrow_forwarddiscuss three key factors that you would consider whenbuying a personal computer. In each of the stated factors, give reasons why you wouldneed to consider them.arrow_forward
- please convert the code in this picture to text onlyarrow_forwardWe are learning the Select Algorithm for the algorithm of order statistics and the images are our notes. if you could explain the algorithm a bit more that would be good, particularly the part I circled in red. Why are the numbers in that order? It doesn't seem to me like they match up to the correct numbers. What does each Select(#, S(#)) point to? Thanks.arrow_forwardProblem Description (CCOs #1, 2, 3, 4, 5, 6, 7, 8, 11, 12) A water tank of radius R = 1.8m with two outlet pipes of radius r₁ = 0.05m and r2 installed at heights h₁ = 0.13m and h₂ = 1m, is mounted in an elevator moving up and down causing a time dependent acceleration g(t) that must be modeled as = 90+ a1 cos(2ƒ₁t) + b₁ sin(2Ã₁t) + a2 cos(2π f₂t) + b₂ sin(2π f₂t), g(t) = (1) Figure 1: Water tank inside an elevator The height of water h(t) in the tank can be modeled by the following ODE, dh dt = f(t) - - PT √√2g(t) (r√✓/max(0, h − h₁) + r¾¾√/max(0, h — h₂) PπR² where p = 1000 kg/m³. The volume flow rate V (t) of water out of the tank is V(t) = π √2g(t) (r²√/max(0, h(t) − h₁) + r²¾√/max(0, h(t) – h₂)) (2) (3) To help determine the model constants in Eq. (1), measurements of the elevator position y(t) are taken every 5s starting att = Os until 2000s. The measured position data is available on Canvas in the Matlab file ydat.mat. The mass flow rate f(t) in kg/s into the tank is measured…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education