1float CoumpoundInterest (float AmountP,float rateP, int termP)//Define the function and FORMAL parameters
2{
3 rateP=rateP/100;
4 float calculation = AmountP * pow(1+rateP,termP);
5 return calculation;
6
7}
8//CALLING THE FUNCTION IN THE MAIN PROGRAM:
9
10//Declaration of ACTUAL paramters
11float amount,rate, total;
12int term;
13
14//Assignment statement to call the function.
15
16cout.setf(ios::fixed);
17cout.precision(2);
18total=CompoundInterets(amount,rate,term)
19
20//OUTPUT
21cout<<total;
22
23