|
sbucareer (m)
|
First let start by elaborating what is meant by compound interest. Compound interest is interest that is paid on both the principal and also on any interest from past years.
Therefore, It’s often used when someone reinvests any interest they gained back into the original investment. So, let take this formula as our benchmark
M = P( 1 + i )^n
M is the final amount including the principal.
P is the principal amount.
i is the rate of interest per year.
n is the number of years invested.
Let's say that I have £100, 000 to invest for 5 years at rate of 15% compound interest.
M = 100, 000 (1 + 0.15)^5 = £201 135.719.
You can see that my £100, 000 is worth £201,135.719.
So, you want to code this algorithm in progamming language like C++, I don't assume you want me to teach you C++. But if you want to learn C++ visit this Tutorial site
Ok!!!
//Declare some variables to hold these fields int signed * finalPrincipalInterest; int signed * principalAmount; int unsigned short * interest; int signed short *numberOfYears;
//Assign the variables data either through dynamic or static data initalization *finalPrincipalInterest = *pow((&principalAmount *(1+&interest)),&numberOfYears);
This I hope can help you with your coursework.
|
|
|
|
|