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,

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!