Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

2. List the advantages of listening well

Answered: 1 week ago