# Thread: cant figure out whats wrong with this ....

1. > 1 5
> 2 5
> 3 5
Sheesh - what were you expecting???

Surely you must have realised by now that doing 100 * 0.05 will be 5 whether you do it once or 100 times.

Code:
```for (int i=1; i < years+1 ; ++i) {
// does temp depend on the value of i - NO!
// is temp going to change? - NO
double temp = forest_rate * uncut_area;
area_forested = (uncut_area + temp * i);
cout << i << " " << temp << endl;
}```

2. ## this is what he expects the program to do......

the formula ( uncut_area + (forest_rate * uncut_area)
using the numbers 10000 total area, 100 left uncut, .05 forest rate
u get 100 + (.05 * 100) which is 105 which equals how much will be left after 1 year
then 105 + (.05 *100) which is 110.25 is what is left after 2 yrs
then 110.25 + (.05*110.25) = 115.7625
an you continue until X number of years has passed ( years is the variable for years)

after 20 years have passed the answer is supposed to be like........635.33? i dont get it i get 105. then 110, then 115 without the decimals.........
werid to use a for loop i know.............i figured out i need some way to tell the lloop to take the number from each year an add it to the previous until X number of years has passed.........then output the answer as area_forested........

3. > u get 100 + (.05 * 100) which is 105 which equals how much will be left after 1 year
> then 105 + (.05 *100) which is 110.25 is what is left after 2 yrs

Surely you mean
> then 105 + (.05 *105) which is 110.25 is what is left after 2 yrs

If so, then like this
Code:
```for (int i=1; i <= years ; ++i) {
uncut_area = uncut_area + (forest_rate * uncut_area);
}```
Then print the value of uncut_area at the end of the loop.