Question

(C++) Suppose you have a certain amount of money is a savings account that earns compound...

(C++) Suppose you have a certain amount of money is a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula, which is known as the future value formula, is: F = P x (1 + i)t The terms in the formula are as follows:

a. F is the future value of the account after the specified time period

b. P is the present value of the account

c. i is the monthly interest rate

d. t is the number of months

Write a program that prompts the user to enter the account’s present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function named futureValue that returns the future value of the account, after the specified number of months. The program should display the account’s future value.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

PROGRAM:

#include <iostream>
using namespace std;
float futureValue(float P,float i,float t); // Declaring the Function Prototype
int main()
{
// Declaring the variables
float present_value,monthly_interest,num_months,result;
  
// Prompt for the user to enter the present value of the account
cout << "Enter Present Value of the account: ";
// Reading the input from user
cin >> present_value;
  
// Prompt for the user to enter the monthly interest rate
cout << "Please enter the monthly interest rate: ";
// Reading the input from user
cin >> monthly_interest;
  
// Prompt for the user to enter the number of months that the money will be left in account
cout << "Enter the number of months: ";
// Reading the input from user
cin >> num_months;
  
// Calling futureValue function to calculate the future value of the account and store it in the result variable
result = futureValue(present_value,monthly_interest,num_months);
  
// Displaying the future value of account to the user
cout << "\nAccount's Future Value after " << num_months << " months is " << result;
}

// Definition of the function futureValue
float futureValue(float P,float i,float t)
{
float F; // Declaring the result variable
  
F = (P*(1+i)*t); // Calculating the futureValue
  
return F; // Returning the futureValue
}

Please refer to the following screenshot of the program for indentation of the code:

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
(C++) Suppose you have a certain amount of money is a savings account that earns compound...
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
  • Suppose you have a certain amount of money in a savings account that earns compound monthly...

    Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value of the account after the specified time period. • p is the present value of the account. • i is the monthly interest rate. • t is the...

  • LULUPULUS! WORK AREA Suppose you have a certain amount of money in a savings account that...

    LULUPULUS! WORK AREA Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f=p* (1 + i)^t • fis the future value of the account after the specified time period. •p is the present value of the account. i is the monthly interest rate. .t is the number of months How...

  • Suppose you want to deposit a certain amount of money into a savings account and then...

    Suppose you want to deposit a certain amount of money into a savings account and then leave it alone to draw interest for the next 10 years. At the end of 10 years you would like to have $10,000 in the account. How much do you need to deposit today make that happen? You can use the following formula, which is known as the present value formula, to find out:                                    P = F / (1+ r)^n The terms in...

  • P5.3      Present Value. Suppose you want to deposit a certain amount of money into a savings...

    P5.3      Present Value. Suppose you want to deposit a certain amount of money into a savings account and then leave it alone to draw interest for the next 10 years. At the end of 10 years you would like to have $10,000 in the account. How much do you need to deposit today tomake that happen? You can use the following formula, which is known as the present value formula, to find out: P = F/(1+r)^n The terms in the...

  • Write a program that calculates the amount of money that you must invest In a savings...

    Write a program that calculates the amount of money that you must invest In a savings account at a given interest rate for a given number of years to have a certain dollar amount at me end of the period Y our program will ask the user for the amount the user wants to have at the end of the term (future value). the number of years the user plans to let the money stay in the account, and the...

  • Visual C# Create Present Value application Application that lets you deposit a certain amount of money...

    Visual C# Create Present Value application Application that lets you deposit a certain amount of money into a savings account and then leave it alone to draw interest for the next 10 years. At the end of 10 years you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? You can use the following present-value formula, to find out. P =F/(1+r)^n P is the present value, or the amount...

  • 14.Compound Interest hank account pays compound interest, it pays interest not only on the principal amount...

    14.Compound Interest hank account pays compound interest, it pays interest not only on the principal amount that was deposited into the account, but also on the interest that has accumulated over time. Suppose you want to deposit some money into a savings account, and let the account earn compound interest for a certain number of years. The formula for calculating the balance of the account afer a specified namber of years is The terms in the formula are A is...

  • How much money should be deposited today in an account that earns 5% compounded semiannually so...

    How much money should be deposited today in an account that earns 5% compounded semiannually so that it will accumulate to $8000 in three years? The amount of money that should be deposited is $ (Round up to the nearest cent.) You deposit $14,000 in an account that pays 5% interest compounded quarterly A. Find the future value after one year B. Use the future value formula for simple interest to determine the effective annual yield. A. The future value...

  • An amount of money was invested in an account that earns interest compounded semiannually. From this...

    An amount of money was invested in an account that earns interest compounded semiannually. From this investment, the investor could withdraw $2,000 at the start of the first 6-month period and at the start of each of the next nine, 6-month periods (a total of ten, 6-month periods), after which time, the account balance is zero. Interest revenue generated from this arrangement equals: A. The future value of the annuity due B. The future value of the annuity due minus...

  • JAVA PLEASE! Suppose you save $100 each month into a savings account with the annual interest...

    JAVA PLEASE! Suppose you save $100 each month into a savings account with the annual interest rate 5%. So, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) * (1 + 0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 + 0.00417)...

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