title: I need to round an output and show xxx.0 for an assignment in C++
body: <p>Can I get some help with my assignment? I had to create a BMI Calculator that takes in test cases and produce a bmi with one decimal place. My code passes most cases but one, where feet = 4, inches = 10, and pounds = 1000. The expected outcome is 209.0 and I can only get 209 to be output, do I just have to make an if statement and add in the ".0" or is there a way to code it?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  int main()
  {
      double feet, inches, pounds, bmi;
  
      cout &lt;&lt; "== BMI Calculator ==" &lt;&lt; endl;
  
      cout &lt;&lt; "Step 1: Enter height" &lt;&lt; endl;
      cout &lt;&lt; "Feet:" &lt;&lt; endl;
      cin &gt;&gt; feet;
      cout &lt;&lt; "Inches:" &lt;&lt; endl;
      cin &gt;&gt; inches;
      cout &lt;&lt; "Step 2: Enter weight" &lt;&lt; endl;
      cout &lt;&lt; "Pounds:" &lt;&lt; endl;
      cin &gt;&gt; pounds;
  
      inches = (feet * 12) + inches;
      bmi = ((pounds * 703) / (inches * inches));
      bmi = ceil(bmi * 10) / 10;
  
      cout &lt;&lt; "BMI: " &lt;&lt; bmi &lt;&lt; endl;
  
      if (bmi &lt; 18.5)
          cout &lt;&lt; "you are underweight." &lt;&lt; endl;
      else if (bmi &gt;= 18.5 &amp;&amp; bmi &lt; 25)
          cout &lt;&lt; "you are normal." &lt;&lt; endl;
      else if (bmi &gt;= 25 &amp;&amp; bmi &lt;= 29.9)
          cout &lt;&lt; "you are overweight." &lt;&lt; endl;
      else
          cout &lt;&lt; "you are obese." &lt;&lt; endl;
  }
  </code></pre>