Question: Write a program that prints the accumulated value of an initial investment invested at a specified annual interest and compounded annually for a specified number

Write a program that prints the accumulated value of an initial investment invested at a specified annual interest and compounded annually for a specified number of years. Annual compounding means that the entire annual interest is added at the end of a year to the invested amount. The new accumulated amount then earns interest, and so forth. If the accumulated amount at the start of a year is acc_amount, then at the end of one year the accumulated amount is:

acc_amount = acc_amount + acc_amount * annual_interest

Use a function that returns the accumulated value given the amount, interest, and years. The prototype is:

float calc_acc_amt(float acc_amount, float annual_interest, int years);

The driver for this program should prompt the user to enter the initial amount, annual interest rate (in decimal, e.g. 0.05 for 5%), and number of years of compounding. The program should process user input until the user enters 0 for the initial amount. AGAIN, before coding this program, you should write the algorithms for calc_acc_amt() and main(), adding them to your algorithms file. Put the source code for this program in the file account.c.

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!