Program 1 main content

Student Learning Objectives

Program Assignment

You will be given a printout of a partially complete BodyMassIndex program during Lab 1 (or pick it up the printout in class lecture if you missed lab). A screen snapshot of the partially completed program is also available.

Complete the missing Java code, type your program into the computer using jGRASP, and fix any errors.

The program can be used to calculate the user's Body Mass Index (BMI). BMI can be used to indicate if you are overweight, obese, underweight or normal.

Women tend to believe they look their best at BMI values between 20 to 22 and men are usually satisfied with a BMI of 23 to 25.

if your BMI is 30 or more, that's not good. However, this simple BMI calculator tends to overestimate BMI in people who are muscular or athletic. Therefore, if your BMI score seems too high, you're not too fat, your just too athletic.

The formula for calculating BMI is

bmi = weight divided by height squared where w is the user's weight (in kilograms) and h is the user's height (in meters).
There are 2.2 pounds in a kilogram and 39.37 inches in a meter.

Sample Output

Program 1 output

What to turn in

Grading Criteria

50 points maximum

URL: http://www.cwu.edu/~schwing/cs110/Java/assignments/program1.html
Title: CS 110: Lab for Programming Fundamentals 1
Author: Ed Gellenbeck, Central Washington University
Last Updated: Monday, January 16, 2006