Question: 1 CALL-BY-VALUE FUNCTION Filename: A3ques11.cpp Suppose you want to deposit a certain amount of money called the principal (P) into a saving account and use

 1 CALL-BY-VALUE FUNCTION Filename: A3ques11.cpp Suppose you want to deposit a

1 CALL-BY-VALUE FUNCTION Filename: A3ques11.cpp Suppose you want to deposit a certain amount of money called the principal (P) into a saving account and use the following formula to calculate the future value (F) after n years, where r is the annual interest rate. Write a program that calls a function named futureValue(int p, int n, double r) that performs this calculation. The function receives the principal (integer), number of years (integer) and annual interest rate (double) as arguments. It should return the future value (double). Next, in your main program, use a while loop with sentinel control to prompt the user to enter the principal, number of years, and annual interest rate, and then call the function future Value. Each answer should be formatted with 2 decimals and trailing zeros. You must verify that the rate is in the range 0

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!