Question

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 formula are as follows:

P is the present value, or the amount that you need to deposit today.

F is the future value that you want in the account. (In this case, F is $10,000.)

r is the annual interest rate.

n is the number of years that you plan to let the money sit in the account.

Write a program that has a function named presentValue that performs this calculation. The function should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the function in a program that lets the user experiment with different values for the formula’s terms.

C:\Windows\system32\cmd.exe What is the desired future value of the account? 10000 What is the annual interest rate? 0.035 hat is the annual interest rate? 8.835 For how many years will the money sit in the account? 5 You need to deposit $8419.73 lant to try another set of values? 〈y = yes): y What is the desired future value of the account? 10000 What is the annual interest rate? 0.045 hat is the annual interest rate? 8.845 For how many years will the money sit in the account? 5 You need to deposit $8024.51. lant to try another set of values? 〈y = yes): n ress any key to continue . . .

C++

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

#include <iostream.h>
#include <math.h>

using namespace std;

double presentValue(double fValue, double rate, int yrs);

int main()
{
   double fValue, rate, pValue;
   int yrs;
   char ch;
   do {
       cout << "What is the desired future value of the account? ";
       cin >> fValue;
       cout << "What is the annual interest rate? ";
       cin >> rate;
       cout << "For how many years will the money sit in the account? ";
       cin >> yrs;
       pValue = presentValue(fValue, rate, yrs);
       cout << "You need to deposit: $" << pValue << endl << endl;
       cout << "Want to try another set of values? (y = yes): ";
       cin >> ch;
   }while(ch == 'y' || ch == 'Y');
   return 0;
}

double presentValue(double fValue, double rate, int yrs)
{
   double pValue;
   pValue = fValue / pow((1 + rate), yrs);
   return pValue;
}

Sample output:

Add a comment
Know the answer?
Add Answer to:
P5.3      Present Value. Suppose you want to deposit a certain amount of money into a savings...
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 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...

  • 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...

  • 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...

  • 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...

  • Find the present value What present value amount do you need to deposit in a bank...

    Find the present value What present value amount do you need to deposit in a bank account with 2.00% annual interest rate to have $100,000.00 at the end of 20 years?  

  • Preb01 Click here to read the eBook: Future Values FUTURE VALUE - If you deposit $8,000...

    Preb01 Click here to read the eBook: Future Values FUTURE VALUE - If you deposit $8,000 in a bank account that pays 8% Interest annually, how much will be in your account after 5 years? Round your answer to the nearest cent. OOOOO o Click here to read the eBook: Present Values o Problem Walk-Through O PRESENT VALUE What is the present value of a security that will pay $22,000 in 20 years if securities of equal risk pay 3%...

  • You deposit $500 into a savings account. You know that the future value will be $800...

    You deposit $500 into a savings account. You know that the future value will be $800 in four years time. What is the annual interest rate you receive from the bank?

  • 4. Introduction to the present value of money Under the concepts of the time value of...

    4. Introduction to the present value of money Under the concepts of the time value of money, you can determine the current, or present, value of a cash receipt or payment that will occur at some specified time in the future, given a specified rate of interest. This technique can be used to calculate the present value of a single or a series of future receipts or payments. Dakota and Gabriella are walking after class between the library and the...

  • Time Value of Money... More Practice 1. Calculate the amount that a person would have to...

    Time Value of Money... More Practice 1. Calculate the amount that a person would have to deposit today at 4% now. would have to deposit today at 4% interest to have $10,000 20 years from Is this a present value or future value problem? Is it an annuity or single amount 2. Calculate the amount that a person would have to deposit today at 10% interest in order to have $55,000 15 years from now. Is this a present value...

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