Question
Compound Interest Overview For this daily, write a program that will act as a compound interest calculator by calculating the future value of an account
Compound Interest Overview For this daily, write a program that will act as a compound interest calculator by calculating the future value of an account after a 4-year period with a fixed interest rate. The program should ask the user for the initial investment amount (double) and the annual interest rate (double). The prompts that are displayed for the user MUST match the prompts that are displayed in the output below. After getting the values from the user, calculate the future value of the account for each year over a 4-year period. For each year, also calculate the amount the account increased from year to year. Finally, display the output so that it is like what is shown in the Output section. Some of the formatting details to follow: - All dollar amounts should be displayed with exactly 2 digits after the decimal point - The initial investment should be displayed in a field that occupies fifteen (15) spaces - The annual interest rate should be displayed with exactly 1 digit after the decimal point in a field that occupies thirteen (13) spaces. - The yearly values for the account and the amounts that the account increased should all be displayed with a leading dollar sign ($) - Print a newline at the end of the output. Calculations Value for year 1 = initial investment + (initial investment * interest rate / 100) Value for year 2 = Value for year 1 + (Value for year 1 * interest rate / 100) Value for year 3 = Value for year 2 + (Value for year 2 * interest rate / 100) Value for year 4 = Value for year 3 + (Value for year 3 * interest rate / 100) File You Must Submit Place the program code in a source file named interest.cpp Output (for 2 runs of the program) How much is the initial investment amount? 5000 What is the annual interest rate? 6.2 Investment Results Initial Investment 5000.00 Annual Interest Rate 6.2 Year 1 account value $5310.00 -- increase of $310.00 Year 2 account value $5639.22 -- increase of $329.22 Year 3 account value $5988.85 -- increase of $349.63 Year 4 account value $6360.16 -- increase of $371.31 Investment Results Initial Investment 120300.01 Annual Interest Rate 7.4 Year 1 account value $129202.21 -- increase of $8902.20 Year 2 account value $138763.17 -- increase of $9560.96 Year 3 account value $149031.65 -- increase of $10268.47 Year 4 account value $160059.99 -- increase of $11028.34
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