#include<iostream>
#include<cmath>
#include<string>
using namespace std;

float getBMI(float w,float h)
{
	float bmi;
	bmi= w/pow(h,2);
	return bmi;
}

void dispStatus(float b)
{
	if ((b>=18.5)&&(b<26))
		cout<< "Status: Normal"<<endl<<endl;
	else if(b<18.5)
		cout<<"Status: Underweight"<<endl<<endl;
	else if ((b>25)&&(b<31))
		cout<<"Status: Overweight"<<endl<<endl;
	else
		cout<<"Status: Obese"<<endl<<endl;
}

void getDetails(char n[100], float w,float h)
{
	cout<<"Name  : "<<n<<endl;
	cout<<"Weight: "<<w<<" kilograms"<<endl;
	cout<<"Height: "<<h<<" meters"<<endl;
	
}

void calcOverall(float tw,float th)
{
	float obmi= tw/pow(th,2);
	if ((obmi>=18.5)&&(obmi<26))
		cout<< "Status: Normal"<<endl<<endl;
	else if(obmi<18.5)
		cout<<"Status: Underweight"<<endl<<endl;
	else if ((obmi>25)&&(obmi<31))
		cout<<"Status: Overweight"<<endl<<endl;
	else
		cout<<"Status: Obese"<<endl<<endl;
}
void getName()
{
	float weight,height;
	float totalw=0,totalh=0;
	do{
		char name[10];
		
		cout<<"Enter name or press <ENTER> key to end => ";
		cin.getline(name,10);
		
		if (name[0]!='\0')
		{
			cout<<endl;
			cout<< "Enter weight(kg) and height(m) => ";
			cin>> weight>>height;
			cout<<endl;
			getDetails(name,weight,height);
			float  i= getBMI(weight,height);
			cout<<"BMI   : "<<i<<endl;
			dispStatus(i);
			totalh+=height;
			totalw+=weight;
			cin.ignore();}
		else if (name[0]=='\0')
			break;
	}while((totalh>0)||(totalw>0));
		calcOverall(totalw,totalh);
		
}

int main()
{

	
	 
	
		getName();
	
	
	
	return 0;
}
