Question: Define a class named person with the following data attributes: _ _ name; _ _ feet; _ _ inches; _ _ weight; The attributes represent

Define a class named person with the following data attributes: __name; __feet; __inches; __weight; The attributes represent a persons name, height measured in feet and inches and weight measured in pounds. The person class should have an __init__ method that creates these attributes. It should also have the following methods: input: Prompts the user for name, feet, inches and weight and sets the private data values to the user entered values. Checks for negative values for feet, inches, and weight and for inches greater than 11. If any of these error conditions occurs, an error message should be displayed, and no values should be set. grow: Increases the persons height by the given number of inches. Feet and inches should be correctly set based on the increase. If the given number of inches is negative, an error message should be displayed, and the values not changed. shrink: Decreases the persons height by the given number of inches. Feet and inches should be correctly set based on the decrease. If the given number of inches is negative, an error message should be displayed, and the values not changed. If the decrease in inches gives a total height value less than 1 inch, an error message should be displayed and the values not changed. gain: Increases the persons weight by the given weight. If the given weight is negative, an error message should be displayed, and the values not changed. lose: Decreases the persons weight by the given weight. If the given weight is negative, an error message should be displayed, and the values not changed. If the decrease in weight gives a total weight value less than 1 pound, an error message should be printed and the values not changed. display: Outputs the name, height and weight with labels and user-friendly formatting. It also computes and displays the persons body mass index, BMI. The formula for this is: BMI = weight *703------------ inches2(Note: this is total height in inches squared) The BMI should be printed with two places after the decimal. See the example for the format the output should follow. 2. Write a Python application program that utilizes the person object. Be sure it imports the person module. It should be menu driven with choices for inputting a persons statistics, growing, shrinking, gaining weight, losing weight, displaying the persons statistics and quitting. Your program should follow the formatting given by the following example (input shown in bold). Note: there are several choices and error conditions not shown in this example. You should test all of these before submitting your program. Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: p Name: UnassignedHeight: 0 feet, 0 inchesWeight: 0 poundsBMI: 0.00 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: e Enter name: Michael Enter height Feet: 5 Inches: 6Weight: 163 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: p Height: 5 feet, 6 inchesWeight: 163 poundsBMI: 26.31 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: g Enter a number of inches to grow: 3 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: s Enter a number of inches to shrink: 2 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: l Illegal data entry, please try again! Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: d Enter a number of pounds to lose: 20 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: p Name: MichaelHeight: 5 feet, 7 inchesWeight: 143 poundsBMI: 22.39 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: i Enter a number of pounds to gain: -3 Number of pounds to gain must be positive! Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: e Enter name: DianeEnter height Feet: -3 Inches: 3Weight: 200 Illegal data entry! You'll need to try again! Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: p Name: MichaelHeight: 5 feet, 7 inchesWeight: 143 poundsBMI: 22.39 Enter one of the following: e: Enter a persons statistics g: Grow by a number of inches s: Shrink by a number of inches i: Increase in weight d: Decrease in weight p: Display the current statistics q: Quit the program Command: q Thanks! Program Ended.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!