Question
C++ Loops Objectives: Using a while loop until user types in a trailer Using a do while loop to check the range of pounds and
C++ Loops 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 Submission: Turn in the source program and your output to D2L. Extra Credit 10 points 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started