6.12.2 Write a python program using the following requirements: The human body has many organs. These...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
6.12.2 Write a python program using the following requirements: The human body has many organs. These organs have some properties in common and others that are specialized. • Create an Organ class as a base class for specific organs o Attributes for the organ class are: organ_name o o · organ_weight_grams ▪ is_transplantable organ_gender Required reserved methods for organ class: ▪ Constructor ▪ • Create a Heart class as a child of the organ class ▪ is_vital_organ I organ_system <Continued next page> Repr method that returns the attributes of organ instance The heart is a vital organ in the Muscular system 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 6.12.2 continued... • Create a Brain class as a child of the organ class o The brain is a vital organ in the Nervous system Attributes for brain, defined in the constructor, are: ▪ brain_volume (in centimeters) o ▪ 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 6.12.2 Write a python program using the following requirements: The human body has many organs. These organs have some properties in common and others that are specialized. • Create an Organ class as a base class for specific organs o Attributes for the organ class are: organ_name o o · organ_weight_grams ▪ is_transplantable organ_gender Required reserved methods for organ class: ▪ Constructor ▪ • Create a Heart class as a child of the organ class ▪ is_vital_organ I organ_system <Continued next page> Repr method that returns the attributes of organ instance The heart is a vital organ in the Muscular system 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 6.12.2 continued... • Create a Brain class as a child of the organ class o The brain is a vital organ in the Nervous system Attributes for brain, defined in the constructor, are: ▪ brain_volume (in centimeters) o ▪ 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
Expert Answer:
Answer rating: 100% (QA)
Based on the requirements given in the screenshots we need to create a Python program that defines a base class Organ for human organs and two child c... View the full answer
Related Book For
Ethics in Accounting A Decision Making Approach
ISBN: 978-1118928332
1st edition
Authors: Gordon Klein
Posted Date:
Students also viewed these algorithms questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A business has the following transactions: The business is started by receiving cash from an investor in exchange for common stock $20,000 The business purchases supplies on account $500 The...
-
How is the separation of ownership from control related to the principal-agent problem?
-
Recent research suggests that the amount of time that parents spend talking about numbers can have a big effect on the mathematical development of their children (Levine, Suriyakham, Rowe,...
-
Differentiate technology from methodology and from method. Can you come up with an example that differentiates these concepts in a specific context, perhaps software development?
-
Kahn has just completed a review of its job- costing system. This review included a detailed analysis of how past jobs used the firm's resources and interviews with personnel about what factors drive...
-
A company is considering two mutually exclusive projects. Both require an initial cash outlay of Rs.20000 each, and have a life of five years. The company's required rate of return is 10% and pays...
-
For each item listed in the table below, input the balance for the date range 10/1/20XX to 12/1/20XX. For the Journal, input the balance for the date range 11/13/20XX to 12/1/20XX. Note: Enter your...
-
Describe Lewin's change management model? How will it benefit the company? and Provide a practical example of how it can used?
-
Ascorbic acid ( vitamin C ) content in soluble vitamin C tablets was studied using iodometric titration. For the sample solution, 1 soluble vitamin tablet with a mass of 4 . 0 0 8 8 g was taken for...
-
12. A Zinc and Copper half cell were connected under standard conditions. Calculate the standard cell potential of the Zinc/ Copper cell. (7marks) Tanis Thinking: a. /8 b. Mr. Samai Unit 5 Test Elect...
-
Succinic acid is a dicarboxylic acid with the formula HOOC ( CH 2 ) 2 COOH. It can be used as a standard substance for NaOH titrant standardization. To carry out the titrant standardization...
-
Exhaust gas from a diesel engine has 6.5% CO 2 , 4.5% CO, 9.0 O 2 , and the balance N 2 . Estimate the cetane number of the fuel supplied (to the nearest whole number). Component Chemical Formula...
-
Phenyl phosphate, is an artificial substrate and incubated with alkaline phosphatase in the presence of 4 mM homoarginine. The data when plotted is a Michaelis - Menton enzyme. The equation of a...
-
Perpendicular vectors. Given vector R(r, y, 2) = (3, 4, 4), obtain (a) a unit vector that lies in the x-y plane and is perpendicular to R and (b) a unit vector T that is perpendicular to both R and...
-
For what reason might an exporter use standard international trade documentation (letter of credit, draft, order bill of lading) on an intrafirm export to its parent or sister subsidiary?
-
In a landmark U.S. Supreme Court case, Price Waterhouse, CPAs v. Hopkins, a senior accountant was denied a promotion to partner at a major CPA firm because, according to one evaluation, she needed to...
-
A doctor has recommended that you have a CAT scan procedure to see if you suffered a concussion in a recent auto accident. The doctor has informed you that she wants you to get a CAT scan procedure...
-
Is privacy an inalienable right that cannot be trampled upon or sold? Have you ever, in effect, sold your privacy rights in return for economic consideration?
-
You are studying survival times for mice given a drug at one of three doses (Low, Medium, or High). You define two dummy variables: (a) With these definitions, write the expressions for the mean...
-
The data in Table 8.25 were collected in order to study factors affecting the supply and demand for commercial air travel. Data on various aspects of commercial air travel for an arbitrarily chosen...
-
It is beneficial to be able to estimate the yield of useful product of a tree based on measurements of the tree taken before it is harvested. Measurements on four such variables were taken on a...
Study smarter with the SolutionInn App