Given the following function prototype for a function calcSavingsInterest which accepts a savings amount, an interest rate and a number of years. void calcSavingsInterest(double& amount, double rate, int yrs); Note: Sample Test data is provided below at the end of the question:
a) Write a definition for the function calcSavingsInterest that will calculate the total amount saved after the interest is applied.
b) Write a C++ program in main() that will call the function calcSavingsInterest after which the total amount earned is output to the computer screen.
c) How would you adapt the function definition to calculate and return the total interest due. Note: Solution must clearly show the new function prototype and the new function definition.
d) Write a C++ program in main() that will call the function calcSavingsInterest written in part c) after which the total interest earned is output to the computer screen.
Assuming an initial amount of €100 and an interest rate of 10% and 3 yrs duration,
the new amount at the end of each year is shown in the table below:
Yrs 1 Amount €110
Yrs 2 Amount €121
Yrs 3 Amount €133.10