Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a class named person which should have the following methods: - Its constructor should take four actual parameters; name, weight in pounds, height in

image text in transcribed
Define a class named person which should have the following methods: - Its constructor should take four actual parameters; name, weight in pounds, height in feet, and the remaining height in inches. (Note: One foot has 12 inches.) - A method givename which returns the name of the person. - A method BMI which returns the body mass index of the person rounded to 1 place of decimal. For weight in pounds and height in inches, BMI is calculated as BMI=(weight/height2)703 Following is a sample usage of the class and the corresponding output. Sample Usage: p1=person("Mary",132,5,6)p2=person("John",140,5.2) print(p1. giveName(0,"has BMI.p1.BMI()) print(p2.giveName0,"has BMI.p2.BMI0) Corresponding output: Mary has BMI 21.3 John has BMI 25.6

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

PostgreSQL 10 High Performance Expert Techniques For Query Optimization High Availability And Efficient Database Maintenance

Authors: Ibrar Ahmed ,Gregory Smith ,Enrico Pirozzi

3rd Edition

1788474481, 978-1788474481

More Books

Students also viewed these Databases questions

Question

Explain why we use yn as an estimate of E(y) and to predict y.

Answered: 1 week ago