Original Post
Hey, I'm a beginning programmer writing this little piece for practice. It finds the BMI of someone. I get a ton of errors when I compile it. Thanks for any help. Oh, and I don't want to completely rewrite it, if possible. I'd like it to stay essentially the same.
#include <iostream>
int convert(int foot, int inch);
int convertWeight(int pound);
int convertFinal(int weight, int height);
using namespace std;
int foot;
int inch;
int pound;
int height;
int weight;
int BMI;
int finalBMI;
int finalHeight;
int finalWeight;
int main() {
cout << "Input your height in feet\n";
cin >> foot;
cout << "Input your height in inches\n\n";
cin >> inch;
height = int convert(int foot, int inch);
cout << "Input your weight in pounds\n";
cin >> pound;
weight = int convertWeight(int pound);
BMI = int convertFinal(int height, int weight);
system("CLEAR");
cout << "Your body mass index is " << BMI <<;
return 0
}
int convert(int foot, int inch) {
int finalHeight = foot * 12 + inch * .0254;
return finalHeight * finalHeight
}
int convertWeight(int pound) {
return pound / 2.2;
}
int convertFinal(int weight, int height) {
return weight / height;
}