01: #include <iostream>
02: #include <cmath>
03: 
04: using namespace std;
05: 
06: double balance;
07: 
08: /** 
09:    Accumulates interest in the global variable balance
10:    @param p the interest rate in percent
11:    @param n the number of periods the investment is held
12: */
13: void future_value(int p, int n)
14: {  
15:    balance = balance * pow(1 + p / 100, n); 
16: }
17: 
18: int main()
19: {  
20:    balance = 10000;
21:    future_value(5, 10);
22:    cout << "After ten years, the balance is "
23:       << balance << "\n";
24:    return 0;
25: }