Question: Write a value return function that can be used to compute the compound interest based on the given formula: Inputs to the functions are: n,
- Write a value return function that can be used to compute the compound interest based on the given formula: Inputs to the functions are: n, t, a, and P
Total compounded interest = P (1 + r/n) (nt) - P
Where P is the principal loan amount
r is the annual interest rate = a/100
n = no of times per year the interest is compounded (if monthly, them n will be 12)
t = number of years the loan is borrowed for. The function should return the total compound interest.
Write a main to compute the compound interest by supplying suitable inputs and display the loan amount and the compound interest.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
