Lab Report #2
Lab Report #2
LBYCPA1
Labaratory Activity #2
FINAL REPORT
Rating: _______
Step 6:
Display female and male height calculated from femur_length. Add unit “in” for
each result.
Display female and male height calculated from humerus_length. Add unit “in”
for each result.
Step 7:
Stop
B. Flowchart
1.
2.
C. Source Code
1.
femur_length = float(input('Enter your Femur Length(in):'))
humerus_length = float(input('Enter your Humerus Length(in):'))
2.
femur_length = float(input('Enter your Femur Length(ft):'))
humerus_length = float(input('Enter your Humerus Length(ft):'))
femur_length = femur_length * 12
humerus_length = humerus_length * 12
fl_female_height = fl_female_height / 12
fl_male_height = fl_male_height / 12
hl_female_height = hl_female_height / 12
hl_male_height = hl_male_height / 12
III. Output
1.
2.
IV. Discussion
For the first part of the problem, we need to ask the value of the length of femur
and humerus length to the user. We can do it by using input() and inside the
parentheses we can put the message we want to show on the screen like “Enter value
here:”. We added a code float() to avoid error when the user type a number that
contains decimal. Then we stated the formula to compute the estimated height. We
wrote in a syntax that can be understand by the computer when using Python like this:
Now, we showed the results on the screen by using the code print() including the
variables that contains the height and a code '%.1f'% before the variable to indicate a
one decimal place only.
The second part of the problem is very similar to the first part but we need to add
some procedure. We the value of the length of femur and humerus length to the user
in terms of feet. Since the formula for the height estimation uses inches we converted
the length from feet to inches by mulpying it with 12. We can now use the formula
given for the height estimation just like we did on the first problem. The height we
get in this formula is in terms of inches and we converted it back to feet by dividing it
to 12. Now, we showed the results on the screen by using the same format but we
replaced “in” into “ft”.
V. Conclusion
In this activity, I learned how to analyze a problem and solve it. Reading
the problem at first seems like a difficult one but it isn’t if you think properly.
First, I define the desired output which is the height of a male and female
estimated with femur and humerus length. Then I consider what process to do to
achieve it. So I put the formula given. At first run of the program, there some
errors I encounter like wrong spellings and what code I must add to make it
correct. Programming really challenges you to think of different ways to solve a
problem.
VI. References
https://www.edmodo.com/file/view-office-online?fid=893504076
https://www.programiz.com/article/algorithm/algorithm-programming
https://www.draw.io/