Compound interest is the practice of taking interest from a loan or account and
ID: 3822374 • Letter: C
Question
Compound interest is the practice of taking interest from a loan or account and adding it back to the original loan or account. The next time that interest is calculated, it will be calculated based on an amount of (1+r) P, where r is the interest rate and P is the original (principal) amount. Given the following function declaration: define a C++ function that can be used to calculate the final value of an account that suns with value dollars and accumulates compound interest over n interest periods. You only need to write the function definition.Explanation / Answer
double currentInterestRate(int r)
{
int x= pow((1+ r/n), (n*t));
//r = the annual interest rate (decimal)
//n = the number of times that interest is compounded per year
//t = the number of years the money is invested or borrowed for
return x/100;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.