Beware there be Homework below.
Edits:
Took out useless information.
So obviously this is a homework assignment everything seems correct besides the calculations inside my functions.
How do I return a non truncated value?
float hat(float weight, float height) {
return (weight/height)*2.9;
}
float jacket(float weight, float height, int age) {
double result = (height * weight) / 288;
/*now for every 10 years past 30 add (1/8) to the result*/
if((age - 30) > 0){
int temp = (age - 30) / 10;
result = result + (temp * .125);
//cout<<"result is: "<<result<<endl;
}
return result;
}
float waist(float weight, int age) {
double result = weight / 5.7;
/*now for every 2 years past 28 we add (1/10) to the result*/
if((age - 28) > 0){
int temp = (age - 28) / 2;
result = result + (temp * .1);
}
return result;}
Set
fixed
: