60 414
Assignments Done
98,2%
Successfully Done
In April 2018

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
Expert's answer
#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

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions