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 steel cylindrical sample was subjected to a tensile test. The yield load was 2100N. The maximum load was 3400N and the failure
Misha Larkins [42]

Answer:

initial diameter of the sample is 2.95 mm

Explanation:

given data

yield load = 2100 N

maximum load = 3400 N

failure load = 2350 N

ultimate engineering stress = 497.4 MPa = 497 × 10^{6} N/m²

to find out

What was the initial diameter of the sample in mm

solution

we will apply here ultimate engineering stress formula that is express as

ultimate engineering stress = \frac{Pmax}{A}    ...............1

here A is area and P max is maximum load applied

so area = \frac{\pi }{4} d^2

here d is initial diameter

so put all value in equation 1

497 × 10^{6}  = \frac{3400}{\frac{\pi }{4} d^2}

solve it we get d

d = 2.95 × 10^{-3} m

so initial diameter of the sample is 2.95 mm

7 0
4 years ago
PLEASE ANSWER SOON
pantera1 [17]

Answer:

I think it is D

Explanation:

I did a couple mins of research on this topic but there is no clear line that separates a physical and chemical reaction, so do with that as you will. i hope I somewhat helped.

8 0
3 years ago
What might cause birds in population to immigration To the island
loris [4]

Mass forest destruction

temperatures

7 0
3 years ago
Read 2 more answers
When was the first black or white hole discovered?
ivolga24 [154]

Answer:

1964

Explanation:

It was discovered in 1964 when a pair of Geiger counters were carried on board a sub-orbital rocket launched from New Mexico.

3 0
3 years ago
Regulation 433.3.3 gives six examples where th
krok68 [10]

Answer:

i need more

Explanation:

8 0
3 years ago
Other questions:
  • Determine the following for a south facing surface at 30� slope in
    9·1 answer
  • Implement the function lastChars() that takes a list of strings as a parameter and prints to the screen the last character of ea
    14·1 answer
  • In what way do you think the motorcycles perform<br> work?
    10·1 answer
  • Motorcycles are extremely hard to see if they are _______. powered by quiet motors approaching from the side driving on the shou
    7·1 answer
  • If the middle bend of a three-bend saddle is a 30-degree bend
    6·2 answers
  • When you receive a vertical promotion, you are more likely to _______ than when you receive a horizontal promotion. a. Deal with
    9·1 answer
  • A customer got debited twice, how would you investigate and resolve this conflict on the customer side and on the company side?
    5·1 answer
  • 16. Which polymers are recyclable?
    15·1 answer
  • What is the primary responsibility of ABET?
    13·1 answer
  • An engineer who invested very well plans to retire now because she has $2,000,000 in her ORP account. How long will she be able
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!