📜  在 C++ 代码示例中计算复利的函数

📅  最后修改于: 2022-03-11 14:44:53.233000             🧑  作者: Mango

代码示例1
float CoumpoundInterest (float AmountP,float rateP, int termP)//Define the function and FORMAL parameters
{
    rateP=rateP/100;
    float calculation = AmountP * pow(1+rateP,termP);
    return calculation;

}
//CALLING THE FUNCTION IN THE MAIN PROGRAM: 

//Declaration of ACTUAL paramters 
float amount,rate, total;
int term;

//Assignment statement to call the function.

cout.setf(ios::fixed);
cout.precision(2);
total=CompoundInterets(amount,rate,term)

//OUTPUT
cout<