title: Calculation Problem C++
body: <p>I'm really new to C++, and this is homework. I don't understand what's going on. When I run this, everything works fine if I put in 60000 for current salary and .05 for pay increase, but if I put in something like 52000 for current salary and .23 for pay increase, then the retroactive pay comes out as 5982.00 instead of 5980.00. Is it something to do with the decimals or something? I don't really know. Thanks in advance.</p>
  
  <pre><code>// Variables
  char fullName[30];  // The user's full name - INPUT
  int currentAnnual;  // The users's current annual salary - INPUT
  float percentIncrease; // The percent increase due on the
                         //   current annual salary - INPUT
  // The retroactive pay
  float retroactive;
  // The new monthly salary based on the pay increase and the new salary
  float monthlySalary;
  // The new salary the user should receive based on their old salary
      //      and their pay increase
  float newSalary;
  
  for(int lcv = 1; lcv &lt;= 3; lcv++)
  {
      // INPUT
      cout &lt;&lt; "What is your full name? ";
      cin.getline(fullName, 30);
      cout &lt;&lt; "What is your current salary? ";
      cin &gt;&gt; currentAnnual;
      cout &lt;&lt; "What is your pay increase (please input percentage in"
              "decimal format)? ";
      cin &gt;&gt; percentIncrease;
  
      // PROCESSING
      newSalary = (currentAnnual * percentIncrease) + currentAnnual;
      monthlySalary = newSalary / 12;
      retroactive = (monthlySalary - (currentAnnual / 12)) * 6;
  
      // OUTPUT
      cout &lt;&lt; endl;
      cout &lt;&lt; fullName &lt;&lt; "'s Salary Information\n";
      cout &lt;&lt; left &lt;&lt; setw(15) &lt;&lt; "New Salary" &lt;&lt; setw(19) &lt;&lt; "Monthly Salary"
              &lt;&lt; "Retroactive Pay\n";
      cout &lt;&lt; setprecision(2);
      cout &lt;&lt; fixed;
      cout &lt;&lt; right &lt;&lt; setw(10) &lt;&lt; newSalary &lt;&lt; setw(19) &lt;&lt; monthlySalary
                  &lt;&lt; setw(20) &lt;&lt; retroactive &lt;&lt; endl &lt;&lt; endl;
      cout &lt;&lt; "&lt;Press enter to continue&gt;";
      cin.ignore(100, '\n');
      cin.ignore(1000, '\n');
      cout &lt;&lt; endl;
  }
  </code></pre>