Question
Write a C++ function named CalculateInterestIncome to return the final amount given the original principal, the annual interest rate (percentage value like 4.3% example), the
Write a C++ function named CalculateInterestIncome to return the final amount given the original principal, the annual interest rate (percentage value like 4.3% example), the compounding frequency, the overall length of time the interest is applied. The total accumulated value, including the principal sum plus compounded interest , is given by the formula:
where:
- A is the final amount
- P is the original principal
- r is the annual interest rate as the absolute value-not as a percentage
- n is the compounding frequency
- t is the overall length of time the interest is applied (expressed using the same time units as r, usually years).
Example:
Suppose a principal amount of $1,500 is deposited in a bank paying an annual interest rate of 4.3%, compounded quarterly. Then the balance after 6 years is found by using the formula above, with P = 1500, r = 0.043, n = 4, and t = 6:
So the amount A after 6 years is approximately $1,938.84. Note the value of r in the formula is the absolute rate not percentage rate.
Do the following:
-
- Follow the UMPIRE process and write only the plan as a code comment
- Write your function
- Document what your function does as a code comment.
- Must pass r, the annual interest rate as a percentage
- In your main program, calculate the final amount for a principal amount of $2000.00 deposited in a bank paying an annual interest rate of 3.0%, compounded monthly for keeping 10 years.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started