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
rosijanka [135]
3 years ago
10

The base class Pet has attributes name and age. The derived class Dog inherits attributes from the base class Pet class and incl

udes a breed attribute. Complete the program to: Create a generic pet, and print the pet's information using print_info(). Create a Dog pet, use print_info() to print the dog's information, and add a statement to print the dog's breed attribute.

Engineering
1 answer:
Nonamiya [84]3 years ago
3 0

Answer:

Explanation:

class Pet:

   def __init__(self):

       self.name = ''

       self.age = 0

   def print_info(self):

       print('Pet Information:')

       print('   Name:', self.name)

       print('   Age:', self.age)

class Dog(Pet):

   def __init__(self):

       Pet.__init__(self)

       self.breed = ''

def main():

   my_pet = Pet()

   my_dog = Dog()

   pet_name = input()

   pet_age = int(input())

   dog_name = input()

   dog_age = int(input())

   dog_breed = input()

   my_pet.name = pet_name

   my_pet.age = pet_age

   my_pet.print_info()

   my_dog.name = dog_name

   my_dog.age = dog_age

   my_dog.breed = dog_breed

   my_dog.print_info()

   print('   Breed:', my_dog.breed)

main()

You might be interested in
A pumping test was made in pervious gravels and sands extending to a depth of 50 ft. ,where a bed of clay was encountered. The n
Vikki [24]

Answer:per minute from the pumping well, a steady state was attained in about 24 hr. The draw-down at a distance of 10 ft. was 5.5 ft. and at 25 ft. was 1.21 ft.

Explanation:

6 0
3 years ago
Locate the centroid y¯ of the composite area. Express your answer to three significant figures and include the appropriate units
german

Answer:

Please see the attached Picture for the complete answer.

Explanation:

4 0
3 years ago
Consider the following ways of handling deadlock: (1) banker’s algorithm, (2) detect
Andrew [12]

Answer:

b

Explanation:

7 0
3 years ago
How high a building could fire hoses effectively spray from the ground? Fire hose pressures are around 1 MPa. (It is also said t
Mrac [35]

Answer:

z_{2} = 91.640\,m

Explanation:

The phenomenon can be modelled after the Bernoulli's Principle, in which the sum of heads related to pressure and kinetic energy on ground level is equal to the head related to gravity.

\frac{P_{1}}{\rho\cdot g} + \frac{v_{1}^{2}}{2\cdot g}= z_{2}+\frac{P_{2}}{\rho\cdot g}

The velocity of water delivered by the fire hose is:

v_{1} = \frac{(300\,\frac{gal}{min} )\cdot(\frac{3.785\times 10^{-3}\,m^{3}}{1\,gal} )\cdot(\frac{1\,min}{60\,s} )}{\frac{\pi}{4}\cdot (0.3\,m)^{2}}

v_{1} = 0.267\,\frac{m}{s}

The maximum height is cleared in the Bernoulli's equation:

z_{2}= \frac{P_{1}-P_{2}}{\rho\cdot g} + \frac{v_{1}^{2}}{2\cdot g}

z_{2}= \frac{1\times 10^{6}\,Pa-101.325\times 10^{3}\,Pa}{(1000\,\frac{kg}{m^{3}} )\cdot(9.807\,\frac{m}{s^{2}} )} + \frac{(0.267\,\frac{m}{s} )^{2}}{2\cdot (9.807\,\frac{m}{s^{2}} )}

z_{2} = 91.640\,m

7 0
3 years ago
What is the need to achieve population inversion​
notka56 [123]

Explanation:

Population inversion is a process of achieving more electrons in the higher energy state than the lower energy state. In order to achieve population inversion, we need to supply energy to the laser medium. The process of supplying energy to the laser medium is called pumping.

3 0
3 years ago
Other questions:
  • A room has a width of 14.1 feet, a length of 15.5 feet, and a ceiling height of 12.0 ft. The average flow rate for this room's a
    6·1 answer
  • Alyssa works for an engineering firm that has been hired to design and supervise the construction of a highway bridge over a maj
    11·1 answer
  • Admission to an aquarium is $14 per person. There is also an IMAX theatre in the building, which charges $8 per ticket for a 3D
    8·1 answer
  • Describe ICP/OES in detail.
    6·2 answers
  • True/False
    15·1 answer
  • Mining is an example of this type of business
    7·1 answer
  • Which of the following has special properties that allow forces and pressure to be distributed evenly?
    15·1 answer
  • W²-5w+14
    16·1 answer
  • Does anyone know how to fix this? It's a chromebook and project where I have to try to fix it​
    9·1 answer
  • Accidents occur as a result of ____ and ____.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!