To declare weight, height, hat size, jacket size, and waist size.
3 (for the count)
180 6 1 // 180 pounds, 6 feet 1 inches, so 73 inches -- thank you calculator
155 5 4 // 155 pounds, 5 feet 4 inches, so 64 inches
165 5 8 // 165 pounds, 5 feet 8 inches, so 68 inches
#include
#include
#include
using namespace std;
double hat(double w, double h);
double jacket(double w, double h);
double waist(double w, double h);
int main()
{
double height;
double weight;
char yesno;
do {
cout << "Please enter your height (in inches). Note that 1 Foot = 12 inches:" << endl;
cin >> height;
cout << "Please enter your weight (in pounds):" << endl;
cin >> weight;
cout << "Your hat size is: " << hat(weight, height) << endl;
cout << "Your jacket size is: " << jacket(weight, height) << endl;
cout << "Your waist size is: " << waist(weight, height) << endl;
cout << "Do you want to run again? Enter Y for yes or N for no" << endl;
cin >> yesno;
} while (yesno == 'y' || yesno == 'Y');
system("PAUSE");
return 0;
}
double hat(double w, double h)
{
double r;
r = (w / h) * 2.9;
return (r);
}
double jacket(double w, double h)
{
double r;
r = (w * h) / 288;
return (r);
}
double waist(double w, double h)
{
double r;
r = w / 4.9;
return (r);
}
Please enter your height (in inches):
73
Please enter your weight (in pounds):
180
Your hat size is: 7.15068
Your jacket size is: 45.625
Your waist size is: 36.7347
Do you want to run again? Enter Y for yes or N for no
Y
Please enter your height (in inches):
64
Please enter your weight (in pounds):
155
Your hat size is: 7.02344
Your jacket size is: 34.4444
Your waist size is: 31.6327
Do you want to run again? Enter Y for yes or N for no
Y
Please enter your height (in inches):68
Please enter your weight (in pounds):165
Your hat size is: 7.03676
Your jacket size is: 38.9583
Your waist size is: 33.6735
Do you want to run again? Enter Y for yes or N for no
N
sh: PAUSE: command not found
Any who, hopefully this helped y’all out. Toodle loo now.