sample week 4 lab

Sample week 4 lab - Week3:SampleLab getCategory Calculator displayOutput calculateBMI getInput BMI Thebodymassindex(BMI)'

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
BMI Calculator displayTerminationMessage displayWelcom eMessage getInput calculateBMI displayOutput getCategory Week 3: Sample Lab The body mass index (BMI) is a measure that is used to determine whether a person's weight is healthy for their height.  The measure can be calculated using the following formula: BMI = (weight * 703) / (height * height) Notice that two values, weight (in pounds) and height (in inches), must be input by the user. The program then uses the  formula to calculate the BMI and displays that value (with an appropriate message) to the user.   Modularize the program.  The program should have separate modules to display a welcome message, get the user’s  input, calculate the body mass index, display the output, and display a termination message.  Include a new module that will determine the category the calculated BMI indicates and include that category in the output  displayed to the user.   BMI  BMI Categories bodyMassIndex < 18.5      underweight bodyMassIndex  18.5 -24.9   normal weight bodyMassIndex  25-25.9   overweight bodyMassIndex  >= 30     obese Include a loop that will allow the user to re-enter the input if he/she chooses.  Be sure that the output for each  input displays before the user is able to re-enter new input values. Note: the following is a link to a windows based BMI calculator created by the National Health and Human Services -  National Institutes of Health.  The categories can be found on this website. http://www.nhlbisupport.com/bmi/ Part 1:  Requirements Analysis : list input variables, processes (modules), and output variables Input variables: height, weight Processes: displayWelcome, getInput, calculateBMI, displayOutput, displayTerminationMessage Output variables: bodyMassIndex,  category Part 2: Hierarchy Chart
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 07/31/2011.

Page1 / 8

Sample week 4 lab - Week3:SampleLab getCategory Calculator displayOutput calculateBMI getInput BMI Thebodymassindex(BMI)'

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online