Trouble calculating correct decimal digits
<p>I am trying to create a program that will do some simple calculations, but am having trouble with the program not doing the correct math, or placing the decimal correctly, or something. Some other people I asked cannot figure it out either.</p>

<p>Here is the code: <a href="http://pastie.org/887352" rel="nofollow">http://pastie.org/887352</a></p>

<p>When you enter the following data:</p>

<ul>
<li>Weekly Wage: <strong>500</strong></li>
<li>Raise: <strong>3</strong></li>
<li>Years Employed: <strong>8</strong></li>
</ul>

<p>It outputs the following data: </p>

<pre><code>Year   Annual Salary
1      $26000.00
2      $26780.00
3      $27560.00
4      $28340.00
5      $29120.00
6      $29900.00
7      $30680.00
8      $31460.00
</code></pre>

<p>And it should be outputting:</p>

<pre><code>Year   Annual Salary
1      $26000.00
2      $26780.00
3      $27583.40
4      $28410.90
5      $29263.23
6      $30141.13
7      $31045.36
8      $31976.72
</code></pre>

<p><em>Here is the full description of the task:</em></p>

<p>8.17 ( Pay Raise Calculator Application) Develop an application that computes the amount of money an employee makes each year over a user- specified number of years. Assume the employee receives a pay raise once every year. The user specifies in the application the initial weekly salary, the amount of the raise (in percent per year) and the number of years for which the amounts earned will be calculated. The application should run as shown in Fig. 8.22. in your text. (fig 8.22 is the output i posted above as what my program should be posting)</p>

<ol>
<li><p>Opening the template source code file. Open the PayRaise.cpp file in your text editor or IDE.</p></li>
<li><p>Defining variables and prompting the user for input. To store the raise percentage and years of employment that the user inputs, define int variables rate and years, in main after line 12. Also define double variable wage to store the user’s annual wage. Then, insert statements that prompt the user for the raise percentage, years of employment and starting weekly wage. Store the values typed at the keyboard in the rate, years and wage variables, respectively. To find the annual wage, multiply the new wage by 52 (the number of weeks per year) and store the result in wage.</p></li>
<li><p>Displaying a table header and formatting output. Use the left and setw stream manipulators to display a table header as shown in Fig. 8.22 in your text. The first column should be six characters wide. Then use the fixed and setprecision stream manipulators to format floating- point values with two positions to the left of the decimal point.</p></li>
<li><p>Writing a for statement header. Insert a for statement. Before the first semicolon in the for statement header, define and initialize the variable counter to 1. Before the second semicolon, enter a loop- continuation condition that will cause the for statement to loop until counter has reached the number of years entered. After the second semicolon, enter the increment of counter so that the for statement executes once for each number of years.</p></li>
<li><p>Calculating the pay raise. In the body of the for statement, display the value of counter in the first column and the value of wage in the second column. Then calculate the new weekly wage for the following year, and store the resulting value in the wage variable. To do this, add 1 to the percentage increase (be sure to divide the percentage by 100.0 ) and multiply the result by the current value in wage.</p></li>
<li><p>Save, compile and run the application. Input a raise percentage and a number of years for the wage increase. View the results to ensure that the correct years are displayed and that the future wage results are correct.</p></li>
<li><p>Close the Command Prompt window.</p></li>
</ol>

<p>We can not figure it out! Any help would be greatly appreciated, thanks!</p>
