Answer to Question #23782 in C++ for EMMANUEL

Question #23782
write a program which inputs a person's height (in centimeters) and weight (in kilograms) and outputs one of the messages: UNDERWEIGHT , NORMAL , OR OVERWEIGHT , using the criteria:
UNDERWEIGHT : weight <height/2.5
NORMAL : height/2.5<=weight<=height/2.3
OVERWEIGHT : height/2.3 < weight
1
Expert's answer
2013-02-06T07:51:54-0500
#include <conio.h>
#include <iostream>

using namespace std;

void main()
{
int height, weight;

cout << "Enter a person's height in centimeters: ";
cin >> height;

cout << "Enter a person's weight in kilograms: ";
cin >> weight;
cout << endl;

if (weight < height / 2.5)
cout << "UNDERWEIGHT";
else if (height / 2.3 < weight)
cout << "OVERWEIGHT";
else
cout << "NORMAL";

cout << endl;
_getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
04.03.21, 22:53

Dear Client, please use panel for submitting new questions

disa
04.03.21, 20:07

Write and run a program that causes negative overflow of a variable of type short int.

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS