User Tools

Site Tools


cs175:data_types_and_input_lab_1

Programming Lab Exercise

BMI.java

The following pseudocode describes how the body mass index can be calculated:

   - Read mass in pounds
   - Read height in feet, inches, e.g. 5 feet, 6 inches
   - Convert height in feet, inches to inches only, e.g. 5 feet, 6 inches = 66 inches
   - BMI = mass x 703 / (height squared)
   - Print the BMI

Translate this pseudocode into a Java program, BMI.java.

Link to source code


cs175/data_types_and_input_lab_1.txt · Last modified: 2014/10/01 15:24 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki