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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started