title: Having trouble getting my if/else statements to work in user defined functions
body: <p>I am currently writing a program that outputs the users hat size, jacket size, and waist size.</p>
  
  <p>Hat Size = weight in pounds divided by height in inches and all that multiplied by 2.9</p>
  
  <p>Jacket size (chest in inches) = height times weight divided by 288 and then adjusted by adding an 1/8 of an inch for each 10 years over the age of 30. ( Note that the adjustment only takes place after a full 10 years, no adjustment between 30 - 39, but 1/8 of an inch is added for age 40.)</p>
  
  <p>Waist in inches = weight divided by 5.7 and then adjusted by adding 1/10 of an inch for each 2 years over the age of 28, full two years, so no adjustment for 29, but a 1/10th of an inch will be added if 30.</p>
  
  <p>This is my code, which runs, and outputs correct values assuming the user doesn't get any of the adjustments, example age : 18.</p>
  
  <p>I set up the if/else statements in my declarations below, however they don't seem to be working currently when returning.</p>
  
  <p>It is a requirement that most if not all calculations done need to be preformed in a function.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cmath&gt;
  #include &lt;cstdio&gt;
  
  
  using namespace std;
  
  
  double hat_size(double weight, double height);
  double jacket_size(double height, double weight, double age);
  double waist_size(double weight, double age);
  
  int main()
  {
      double height, weight, age;
      double Hat_size, Jacket_size, Waist_size;
      char answer;
  
      do
      {
  
          cout &lt;&lt; "Please enter the users age: ";
          std::cin &gt;&gt; age;
  
  
          cout &lt;&lt; "\n\nPlease enter users height in inches: ";
          std::cin &gt;&gt; height;
  
          cout &lt;&lt; "\nPlease enter the users weight in pounds: ";
          std::cin &gt;&gt; weight;
  
  
  
  
          Hat_size = hat_size(weight, height);
          Jacket_size = jacket_size(height, weight, age);
          Waist_size = waist_size(weight, age);
  
          cout &lt;&lt; "\nHat Size is: "
               &lt;&lt; Hat_size;
          cout &lt;&lt; "\nJacket Size is: "
              &lt;&lt; Jacket_size
              &lt;&lt; " inches";
          cout &lt;&lt; "\nWaist Size is: " 
               &lt;&lt; Waist_size
               &lt;&lt; " inches";
  
  
          /*  
  
          cout.setf(ios::fixed);
          cout.setf(ios::showpoint);
          cout.precision(2);
  
          */
  
          cout &lt;&lt; "\n\nDo you want to preform another calculation? Please type Y:\n";
          std::cin &gt;&gt; answer;
      } while (answer == 'y' || answer == 'Y' || answer == 'yes' || answer == 'Yes');
  
  
      return 0;
  }
  
  double hat_size(double weight, double height)
  {
      return((weight / height)*2.9);
  }
  
  double jacket_size(double height, double weight, double age)
  {
      double j_size, j_age_shrink, jacket_adjustment, j_change;
  
      j_size = ((height * weight) / 288);
      jacket_adjustment = 1 / 8;
      j_age_shrink = (age / 10 - 3) * jacket_adjustment;
      j_change = j_size + j_age_shrink;
  
      if ((age / 10) &gt;= 4)
      {
          return (j_change);
      }
      else
      {
          return (j_size);
      }
  }
  
  
  double waist_size(double weight, double age)
      {
          double w_size, w_age_shrink, waist_adjustment, w_change;
  
          w_size = (weight / 5.7);
  
          waist_adjustment = 1 / 10;
          w_age_shrink = ((age - 28) / 2) * waist_adjustment;
          w_change = w_size + w_age_shrink;
  
          if (age &gt;= 30)
          {
              return(w_change);
          }
          else
          {
              return (w_size);
          }
      }
  </code></pre>