Question

Write a program that prints the accumulated value of an initial investment invested at a specified...

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 (Code must be in C language).

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Write a program that prints the accumulated value of an initial investment invested at a specified...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Computing Future Investment Value Problem Description: Write a method that computes future investment value at a...

    Computing Future Investment Value Problem Description: Write a method that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the following formula: 12 futurelnvestmentValue investmentAmountx(1+ monthlylnterestRate) Use the following method header: publie static double futureInvestnentValue double investnentAmount, double monthlyInterestRate, int years) For example, futur Investmentvalue( 1eeee, อ.es/12, 5) returns 12833.59 Write a test program that prompts the user to enter the investment amount (e.g. 1000) and the interest...

  • Write a program in Python that computes the interest accrued on an account. You can modify...

    Write a program in Python that computes the interest accrued on an account. You can modify the “futval.py” program given in Chapter 2 to accomplish it. Your program should use a counted loop rather than a formula. It should prompt the user to enter the principal amount, the yearly interest rate as a decimal number, the number of compounding periods in a year, and the duration. It should display the principal value at the end of the duration. To compute...

  • Using basic c++ write a separate code for each of the following: 1. Area Rectangle •...

    Using basic c++ write a separate code for each of the following: 1. Area Rectangle • Write a program that asks the user to enter length and width of a rectangle and then display the rectangles area. • Write the following functions • getLength – prompt the user to enter length and return that value as a double • getWidth – prompt the user to enter width and return that value as a double • getArea – This method should...

  • This C++ Program should be written in visual studio 2017 You are to write a program...

    This C++ Program should be written in visual studio 2017 You are to write a program that can do two things: it will help users see how long it will take to achieve a certain investment goal given an annual investment amount and an annual rate of return; also, it will help them see how long it will take to pay off a loan given a principal amount, an annual payment amount and an annual interest rate. When the user...

  • Write a PYTHON program that allows the user to navigate the lines of text in a...

    Write a PYTHON program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the...

  • c++ and please add tables and everything and make sure program is complete. Write a menu...

    c++ and please add tables and everything and make sure program is complete. Write a menu driven program, which would compute compound interest and a monthly payment for a loan. The user will be given a choice to display the info on the screen or to a filo Menu will be the following Enter (1) to calculate your loan monthly payment Enter (2) to calculate your loan monthly payment & write to a file Tips: Compound Interest Formula A =...

  • Write a program that performs the following: - Reads from the file "myfile.txt" using readlines() -...

    Write a program that performs the following: - Reads from the file "myfile.txt" using readlines() - Prints out the contents of the file "myfile.txt", that was read into a list by readlines(). Note that this should not look like a list, so you will need to loop through the list created by readlines and print the text. - Use the try/except method to create the file if it does not exist - If the file does not exist, prompt the...

  • Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator)...

    Please help me do this program. Add some comments on it. *15.5 (Create an investment-value calculator) Write a program that calculates the future value of an investment at a for the calculation is given interest rate for a specified number of years. The formula investmentAmount * (1monthlyInterestRate ) years *12 futureValue Use text fields for the investment amount, number of years, and annual interest rate. Display the future amount in a text field when the user clicks the Calculate button,...

  • Write the Code in C program. Create a random password generator that contains a user-specified number...

    Write the Code in C program. Create a random password generator that contains a user-specified number of characters. Your program should prompt the user for the desired length of the password. Length of password: To create your password, use the random number generator in the stdlib.h C library. To generate random numbers, you will need the srand() and rand() functions. srand(seed) is used to "seed" the random number generator with the given integer, seed. Prompt the user for the seed...

  • The formula AEP 1 + describes the accumulated value, A, of a sum of money, P,...

    The formula AEP 1 + describes the accumulated value, A, of a sum of money, P, the principal, after t years at annual percentage rater (in decimal form) compounded n times a year. Complete the table for a savings account subject to n compounding periods per year. Amount Number of Annual Interest Accumulated Timet Invested Compounding Periods Amount in Years $14.500 6.25% $21,000 Rate tx 6.0 years (Do not round until the final answer. Then round to one decimal place...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT