Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi there ! problem 6.12.2 reads as follow with the following requirements, can you help? The human body has many organs. These organs have some

Hi there ! problem 6.12.2 reads as follow with the following requirements, can you help? The human body has many organs. These organs have some properties in common and others that are specialized.

Need an organ class as a base class for specific organs

o Attributes for the organ class are:

organ_name

organ_weight_grams

is_vital_organ

organ_system

is_transplantable

organ_gender

o Required reserved methods for organ class:

Constructor

Repr method that returns the attributes of organ instance

Need a Heart class as a child of the organ class

o The heart is a vital organ in the Muscular system

o Attributes for heart, defined in the constructor, are:

heart_length_cm

heart_weight_grams (use the parent class)

heart_thickness_cm

heart_breadth_cm

o Required reserved methods for heart class:

Constructor

Repr method that returns the attributes of heart instance

o Required general methods for heart class:

heart_status - returns 'Pumping blood'

heart_weight_oz - returns the heart weight in ounces

1 gram = 0.035 ounces

Need a Brain class as a child of the organ class

o The brain is a vital organ in the Nervous system

o Attributes for brain, defined in the constructor, are:

brain_volume (in centimeters)

brain_weight_gram (use the parent class)

o Required reserved methods for brain class:

Constructor

Repr method that returns the attributes of brain instance

o Required general methods for brain class:

brain_status - returns 'Thinking'

brain_weight_oz - returns the brain weight in ounces

1 gram = 0.035 oz

Include a unit test in an if __name__ block to test the class. Use assert to check for errors.

Unit Test Template:

Instantiate the heart object with attributes 12, 280, 6.0, 9.0

Instantiate the brain object with attributes 1260, 1370.0

Test that all the parent and child attributes match what was instantiated

Test that the general methods return the appropriate values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions