1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
double hat(double weight, double height);
double jacket(double weight, double height, int age, int x);
double waist(double weight, int age, int y);
using namespace std;
int main()
{
cout << 1 / 8;
int age, x, y;
double height, weight;
if ((age - 30) / 10 > 0)
{
x = (age - 30) / 10;
}
else if (age <= 30)
{
x = 0;
}
if ((age - 28) / 2 > 0)
{
y = (age - 28) / 2;
}
else if (age <= 28)
{
y = 0;
}
cout << "Input your age." << endl;
cin >> age;
cout << "Input your height in feet." << endl;
cin >> height;
cout << "Input your weight in pounds." << endl;
cin >> weight;
cout << "Your hat size is " << hat(weight, height) << "." << endl;
cout << "Your jacket size is " << jacket(weight, height, age, x) << "." << endl;
cout << "Your waist size in inches is " << waist(weight, age, y);
return 0;
}
double hat(double weight, double height)
{
return (weight / height) * 2.9;
}
double jacket(double weight, double height, int age, int x)
{
return ((height * weight) / 288) + ((1.0/8.0) * x);
}
double waist(double weight, int age, int y)
{
return ((weight / 5.7) + ((0.1) * y));
}
|