ABSTRACT
Welcome to Great Minds Tuition Club!!!!Extra
classes done right, explaining the WHY in order
to properly understand the HOW.FOR MORE
ASSIGNMENT SOLUTIONS 0613610251
INP1501
INP1501 ASSIGNMENT 2 SEMESTER 2 2022
DUE DATE:15 SEPTEMBER 2022
, GREAT MINDS TUITION CLUB INP1501 ASSIGNMENT 2 SEMESTER 2 2022 SEPTEMBER 2022
Question 1
#include <iostream>
using namespace std;
void getData(float& height, float& weight)
{
cout<<"Enter height: ";
cin>>height;
cout<<"Enter weight: ";
cin>>weight;
}
float calcBMI(float height, float weight)
{
float bmi =(float) weight/(float)(height*height);
return bmi;
}
void displayFitnessResults(float bmi)
{
if(bmi>=30)
{
cout<<"Obese";
}
else if(bmi>=25)
{
cout<<"Overweight";
}
else if(bmi>=18.5)
{
cout<<"Healthy";
}
else
{
cout<<"Underweight";
}
}
int main()
{
float height, weight;
1|Page
Welcome to Great Minds Tuition Club!!!!Extra
classes done right, explaining the WHY in order
to properly understand the HOW.FOR MORE
ASSIGNMENT SOLUTIONS 0613610251
INP1501
INP1501 ASSIGNMENT 2 SEMESTER 2 2022
DUE DATE:15 SEPTEMBER 2022
, GREAT MINDS TUITION CLUB INP1501 ASSIGNMENT 2 SEMESTER 2 2022 SEPTEMBER 2022
Question 1
#include <iostream>
using namespace std;
void getData(float& height, float& weight)
{
cout<<"Enter height: ";
cin>>height;
cout<<"Enter weight: ";
cin>>weight;
}
float calcBMI(float height, float weight)
{
float bmi =(float) weight/(float)(height*height);
return bmi;
}
void displayFitnessResults(float bmi)
{
if(bmi>=30)
{
cout<<"Obese";
}
else if(bmi>=25)
{
cout<<"Overweight";
}
else if(bmi>=18.5)
{
cout<<"Healthy";
}
else
{
cout<<"Underweight";
}
}
int main()
{
float height, weight;
1|Page