run compiler w/o precompiled headers
i cant find that darn ";" bug, can ya bros help? Thanks
#include <cmath>
#include <iostream>
using namespace std;
//Function prototype for hat size
double calc_hat_size(int weight, int height);
//Funtion prototype for jacket size
double calc_jacket_size(int height, int weight, int age);
//Function prototype for waist size
double calc_waist_size(int weight, int age);
//Function prototype for show results
void show_results(double hat, double jacket, double waist);
int main()
{
//boolean condition set to false
bool cont = false;
//Intialized variables
char answer = 'y';
int age, height, weight;
double hat_size, jacket_size, waist_size;
do{
cout << "Please input in your height in inches: " << endl;
cin >> height;
cout << endl;
cout << "Please input your weight in pounds: " << endl;
cin >> weight;
cout endl;
cout << "Please input your age: " << endl;
cin >> age;
cout << endl;
//Function calls
hat_size = calc_hat_size(weight, height);
jacket_size = calc_jacket_size(height, weight, age);
waist_size = calc_waist_size(weight, age);
show_results(hat_size, jacket_size, waist_size);
cout << "Continue (y/n) ? ";
cin >> answer;
cont = (answer == 'y');
//End while
}while(cont);
return 0;
}
/*********************************************/
//Function calc_hat_size()
double calc_hat_size(int weight, int height){
double const HAT_CONST = 2.9;
return((weight/height) * HAT_CONST);
}
/*********************************************/
/************************************************** ******/
//Function calc_jacket_size
double calc_jacket_size(int height, int weight, int age){
double const JACKET_CONST = 288.0;
double value, rv;
if(age > 39){
value = (height * weight) / JACKET_CONST + .125;
rv = value;
}
if(age < 40){
value = (height * weight) / JACKET_CONST;
rv = value;
}
return(rv);
}
/*******************************************/
/*******************************************/
//Function calc_waist_line()
double calc_waist_size(int weight, int age){
double const WEIGHT_CONST = 5.7;
double value, rv;
if(age > 29){
value = (weight/WEIGHT_CONST) + .1;
rv = value;
}
if(age < 30){
value = (weight/WEIGHT_CONST);
rv = value;
}
return(rv);
}
/********************************************/
/********************************************/
//Function show_results()
void show_results(double hat, double jacket, double waist){
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(1);
cout << "Your hat size is: " << hat << endl;
cout << "Your jacket size is: " << jacket << endl;
cout << "Your waist size is: " << waist << endl;
return;
}
/********************************************/