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
4. Calculate the square root of potato using the sqrt() function. Print out the value of potato again to verify that the value o
N76 [4]

Answer:

potato<-100

print(potato)

sqrt(potato)

potato<-potato*2

print(potato)

Explanation:

The complete question is as follows

Create a variable called potato whose value corresponds to the number of potatoes you’ve eaten in the last week. Or something equally ridiculous. Print out the value of potato.

Calculate the square root of potato using the sqrt() function. Print out the value of potato again to verify that the value of potato hasn’t changed.

Reassign the value of potato to potato * 2.

Print out the new value of potato to verify that it has changed

The question was answered using R programming language.

At line 1, I assumed that I ate 100 potatoes in the previous week.

So, potato = 100

At line 2, the value of potato is printed as 100.

At line 3, the square root of potato is calculated using sqrt function: Square for of 100 = 10

At line 4,the initial value of potato is doubled and stored in potato variable. 100 * 2 = 200

At line 5, the new value of potato is printed: 200.

8 0
4 years ago
A. Calculate the fraction of atom sites that are vacant for lead at its melting temperature of 327°C (600 K). Assume an energy f
NISA [10]

Answer:

a. Fraction of Atom = 2.41E-5 when T = 600K

b. Fraction of Atom = 5.03E-10 when T = 298K

Explanation:

a.

Given

T = Temperature = 600K

Qv = Energy for formation = 0.55eV/atom

To calculate the fraction of atom sites, we make use of the following formula

Nv/N = exp(-Qv/kT)

Where k = Boltzmann Constant = 8.62E-5eV/K

Nv/N = exp(-0.55/(8.62E-5 * 600))

Nv/N = 0.000024078672493307

Nv/N = 2.41E-5

b. When T = 298K

Nv/N = exp(-0.55/(8.62E-5 * 298))

Nv/N = 5.026591237904E−10

Nv/N = 5.03E-10 ----- Approximated

6 0
4 years ago
Need help finding the pats of a transformer (Electronics Science) Any help would be appreciated.
Yakvenalex [24]

Answer:

21 coils

Explanation:

3 0
3 years ago
Read 2 more answers
A metal having a cubic structure has a density of , an atomic weight of , and a lattice parameter of Å One atom is associated wi
Veronika [31]

Answer:

Explanation:

Answer: The crystal structure of the metal is BCC

Explanation:

we first calculate the volume of the unit cell.

Volume of unit cell= (a°)^3.

The lattice parameter here is a°.

Substitute (6.13 * 10^-8)cm for a°.

Volume of unit cell = (6.13 * 10^-8)^3 = 2.3034 * 10^-22 cm^3/cell.

To determine the crystal structure we use

Density (p) = {(Number of atoms per cell) (Atomic mass)} / {(volume of unit cell)(Avogrado constant)}.

Substitute 1.892g/cm^3 for p (6.02*10^23) atoms/mol for Avogrado constant 1.3921g/mol.

For atomic mass and (2.3034 * 10^-22) cm^3/cell for unit cell.

1.892g/cm^3 = {(Number of atoms per cell) (1.3291g/mol)} / {(2.3034 * 10^-22) (6.02 * 10^23 atoms/mol)}.

Changing the subject of formula we have :

Number of atoms per cell = {(2.3034 * 10^-22) * (6.02 * 10^23) * 1.892} / 132.91

Number of atoms per cell = 2.

Since the number of atoms per cell is 2, :. the crystal structure of metal is BCC.

Note: p = density

a° = a subscript o

4 0
3 years ago
Given: A graphite-moderated nuclear reactor. Heat is generated uniformly in uranium rods of 0.05m diameter at the rate of 7.5 x
sineoko [7]

Answer:

The maximum temperature at the center of the rod is found to be 517.24 °C

Explanation:

Assumptions:

1- Heat transfer is steady.

2- Heat transfer is in one dimension, due to axial symmetry.

3- Heat generation is uniform.

Now, we consider an inner imaginary cylinder of radius R inside the actual uranium rod of radius Ro. So, from steady state conditions, we know that, heat generated within the rod will be equal to the heat conducted at any point of the rod. So, from Fourier's Law, we write:

Heat Conduction Through Rod = Heat Generation

-kAdT/dr = qV

where,

k = thermal conductivity = 29.5 W/m.K

q = heat generation per unit volume = 7.5 x 10^7 W/m³

V = volume of rod = π r² l

A = area of rod = 2π r l

using these values, we get:

dT = - (q/2k)(r dr)

integrating from r = 0, where T(0) = To = Maximum center temperature, to r = Ro, where, T(Ro) = Ts = surface temperature = 120°C.

To -Ts = qr²/4k

To = Ts + qr²/4k

To = 120°C + (7.5 x 10^7 W/m³)(0.025 m)²/(4)(29.5 W/m.°C)

To = 120° C + 397.24° C

<u>To = 517.24° C</u>

5 0
4 years ago
Other questions:
  • A heating cable is embedded in a concrete slab for snow melting. The heating cable is heated electrically with joule heating to
    9·1 answer
  • What is the net force acting on a 15kg sled that acceleration at 5m/s^2?
    11·1 answer
  • Assuming the point estimate in Problem 6.36 is the true population parameter, what is the probability that a particular assay, w
    15·1 answer
  • explain the four functional blocks on an oscilloscope and describe the major controls within each block
    6·1 answer
  • Consider a steady-state experiment in which the observed current due to reduction of Ox to R is 85 mA/cm2. What is the concentra
    12·1 answer
  • Someone claims that in fully developed turbulent flow in a tube, the shear stress is a maximum at the tube surface. Is this clai
    5·1 answer
  • Why is sssniperwolf so fine
    9·2 answers
  • What is the name for a program based on the way your brain works?
    13·2 answers
  • Charging the system is being discussed. Technician A says that the refrigerant must be weighed (or metered) to obtain a proper c
    10·1 answer
  • 4. An electrician's pen knife often
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!