Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview Write a C++ program that will act as a compound interest calculator. It will calculate the future value of an account after a 4

Overview

Write a C++ program that will act as a compound interest calculator. It will calculate the future value of an account after a 4 year period with a fixed interest rate.

The program should begin by asking/prompting the user for the initial investment amount for the account and the annual interest rate. Both of these values are double/float values and they should be stored in separate double/float variables that have meaningful names.

After the initial investment amount and annual interet rate have been entered, use the two values to calculate the future value of the account. Use the following formulas:

 Value for year 1 = inital investment amount + (initial investment amount * annual interest rate / 100) Value for year 2 = Value for year 1 + (Value for year 1 * annual interest rate / 100) Value for year 3 = Value for year 2 + (Value for year 2 * annual interest rate / 100) Value for year 4 = Value for year 3 + (Value for year 3 * annual interest rate / 100) Future value of the account = Value for year 4 

The "value for year"s listed in the formulas are also double/float values.

Once the future value of the account has been calculated, display the initial investment amount, annual interest rate, and future value of the account in a nicely formatted manner with the first digit of each number aligned. The sample output can be used as a pattern for how the output should look.

Program Requirements

#include  #include  using namespace std; 

Include the following lines of code BELOW the documentation box:

Use type float or double for the values read in from the user and the calculated values. Use meaningful variable names.

It is okay to assume that the annual interest rate will be entered as a percentage. For example, if the annual interest rate is 5%, the user will enter 5 or 5.0.

Sample Output:

A couple of runs of the program might resemble the following:

Run 1:

Enter an amount to invest: 5000 Enter an annual interest rate: 6.2 ************************************** Investment Result ************************************** Initial Amount: 5000 Interest Rate: 6.2 Final Value: 6360.16 

Run 2:

Enter an amount to invest: 1200.25 Enter an annual interest rate: 4 ************************************** Investment Result ************************************** Initial Amount: 1200.25 Interest Rate: 4 Final Value: 1404.12 

NOTE: The numbers displayed will vary with the user's input. All of the other text and asterisks are to be hard

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions