Question: Program 1: Calculate Body Mass Index (BMI) Given the form shown below write a Visual Basic Program that computes BMI. You can download the form
Program 1: Calculate Body Mass Index (BMI)
Given the form shown below write a Visual Basic Program that computes BMI. You can download the form for this project here:
Download the zip file. (Links to an external site.)
| Instructions: The form above is used to calculate the Body Mass Index (BMI) given a person's height in inches. The height is typed into the two text boxes - feet in one and inches in the other. For example a person that is 5 feet 10 inches would type 5 into the feet box and 10 into the inches box. When the Compute button is pressed the resulting Body Mass Index is shown in the list box at the bottom. NOTE: You will need to compute total height in inches based on the inputs for feet and inches.
The formula for BMI is: BMI = ((weight in pounds) / (height in inches squared)) times 703.
Using each of the five steps listed below and presented in class complete this problem.
1. Analyze the problem. Identify the variables and constants that you may need. Give a description of the problem using comments at the top of your code. 2. Declare all variables using the DIM statements. Name variables so that the quantity they represent is apparent. 3. Initialize all variables by giving them values with assignment statements or by importing values from the user interface - text boxes. 4. Write Visual Basic statements that perform the calculations. 5. Output the results to the list box (in this problem but in general you could also display output using a label or text box.) |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
