Question: I NEED THE CODE FOR THIS HOMEWORK PLEASE. C++ ONLY Objectives: Using a while loop until user types in a trailer Using a do while

I NEED THE CODE FOR THIS HOMEWORK PLEASE. C++ ONLY

Objectives:

Using a while loop until user types in a trailer

Using a do while loop to check the range of pounds and height

Using a nested if statement

Instructions:

In this lab you will code a single program to calculate the Body Mass Index (BMI) of a person. Read in from the user his/her height in inches and weight in pounds. Use the formula

BMI = 703( pounds/height2)

When reading in the data, check to make sure the weight is between 20 and 300 pounds and the height is between 48 and 96 inches. Print an error message if the weight, height or both are out of range.

Keep reading data until the user types in -1 -1.

Print out the users weight, height, BMI and proper category in a report format with appropriate headings.

BMI Categories: Underweight = <18.5 Normal weight = 18.524.9 Overweight = 2529.9 Obesity = BMI of 30 or greater

Sample Heading:

WEIGHT HEIGHT BMI CATEGORY ERRORS

Run:

Use the following data:

55

60

35

68

82

Your weight Your height

-1 -1

Extra Credit

Code two programs that print 10 random numbers from 1-100, each using a for loop. In the first program, do not use the srand(time(0)); statement and in the second, use the srand(time(0)); statement. Run each program twice and explain how the srand changed the four separate outputs. Include the two .cpp files and the 4 .txt files in the zipped folder with the rest of Lab 4.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!