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 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#include <iostream>
#include <iomanip>
using namespace std;
void get_data (int weight,int feet,int inches);
void show_results (float hatsize, int jacketsize, int waistsize);
float hat_size (int weight,int feet, int inches);
int jacket_size (int weight,int feet,int inches);
int waist_size (int weight);
int main()
{
int weight, feet, inches, height, jacketsize, waistsize;
float hatsize;
cout<<"This program will get your hat, jacket, and waist sizes \n";
get_data(weight,feet,inches);
hat_size(weight, feet, inches);
jacket_size(weight, feet, inches);
waist_size(weight);
show_results(hatsize,jacketsize,waistsize);
}
void get_data (int weight,int feet,int inches)
{
cout<<"Please enter your weight in pounds \n";
cin>>weight;
cout<<"Please enter your height in feet and inches \n";
cin>>feet>>inches;
}
float hat_size (int weight,int feet,int inches)
{
float hatsize;
hatsize=2.9*weight/((feet*12))+inches;
return hatsize;
}
int jacket_size (int weight,int feet,int inches)
{
int jacketsize;
jacketsize=((feet*12)+inches)*weight/288;
return jacketsize;
}
int waist_size (int weight)
{
int waistsize;
waistsize=weight/4.9;
return waistsize;
}
void show_results (float hatsize, int jacketsize, int waistsize)
{
cout<<"Your hat size is "<<hatsize<<endl;
cout<<"Your jacket size is "<<jacketsize<<endl;
cout<<"Your waist size is "<<waistsize<<endl;
}
|