I am writing a program that asks for the user's height, weight, and age, and then computes clothing sizes according to the formulas.
However, the division and multiplication seems to be a little off. I think I passed all of the variables, but there is still a problem.
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
double hatsize(double weightPar, double heightPar);
double jacketsize(double weightPar, double heightPar);
double waistsize(double weightPar);
int main()
{
double height, weight, age;
cout << "Height: ";
cin >> height;
cout << "Weight: ";
cin >> weight;
cout << "Age: ";
cin >> age;
cout << "Your recommended hat size is ";
hatsize(height, weight);
cout << "\n";
cout << "Your recommended jacket size is ";
jacketsize(height, weight);
cout << "\n";
cout << "Your recommended waist size is ";
waistsize(weight);
return 0;
}
double hatsize(double weightPar, double heightPar)
{
double hat, weight, height;
hat = ((weight/height)*2.90);
cout << hat;
return (hat, height, weight);
}
double jacketsize(double weightPar, double heightPar)
{
double jacket, weight, height;
jacket = ((height*weight)/288.0);
cout << jacket;
return (jacket, weight, height);
}
double waistsize(double weightPar)
{
double waist, weight;
waist = (weight/5.7);
cout << waist;
return (waist, weight);
}