1. In this assignment, you are going to write codes that calculate standard weig
1. In this assignment, you are going to write codes that calculate standard weight for male and female based on his or her height.
2. The standard weight formula:
male: height (in meters) * height * 48.5 (lbs)
female: height * height * 46 (lbs)
*For those who are not familiar with meters, convert the height in feet/inches to meters on Google.
3. Conditions:
a. First, define a function. Let’s call it “std_weight”
For example, def std_weight(____,____):
b. input variables are gender and height
c. round to two decimal places for weight
d. Sample output statement: “The standard weight for 1.75m male is 148.55lbs.”
4. Once you write codes, copy and paste them onto MS word doc.
Suggestions
1. First, define a function and indicate input variables
2. Use “if” statement for male case, compute the weight based on the formula, and print out the statement. Then, use “else” statement for female case. Follow the same suit as in male case
Leave a Reply