I need help creating a flowchart from this source code and I have no idea how to start. I already made the program and the flowchart/pseudocode is what I am stuck on.
//This program is used to calculate the BMI of a person
//and display whether the person is underweight, overweight, or healthy
//BMI = weight*703/height^2
//weight is measured in pounds/lbs
//height is measured in inches
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
double weight, height; //define values
float BMI;
cout<<"Enter your weight in pounds: "<<endl;
cin>>weight;
cout<<"Enter your height in inches: "<<endl;
cin>>height;
BMI = (weight*703)/(height*height);
cout<<fixed<<showpoint<<setprecision(1);
cout<<"Your BMI is "<<BMI<<endl;
if (BMI<18.5)
{
cout<<"You are underweight. Eat more food, your too skinny!\n"<<endl;
}
elseif (BMI>=18.5 && BMI<=25)
{
cout<<"You have optimal weight. You are healthy, well done!\n"<<endl;
}
elseif (BMI>25)
{
cout<<"You are overweight. Stop eating so much junkfood and excercise, you fatty!\n"<<endl;
}
system("pause");
return 0;
}
This is a little too trivial for a flowchart imo as flowcharts are best suited for OOB solutions or ones with several function calls. You could create a sequence diagram that shows the flow of command. That would be as simple as following you main from top to bottom.
As for pseudocode just write the program in structured English.