Chapter 12 Exercise 13 13. Typically, everyone saves money periodically for reti
ID: 3549498 • Letter: C
Question
Chapter 12 Exercise 13
13. Typically, everyone saves money periodically for retirement, buying a house, or for some other purposes. If you are saving money for retirement, then the money you put in a retirement fund is tax sheltered, and the employer also makes some contribution into your retirement fund. In this exercise, for simplicity, we assume that the money is put into an account that pays a fixed interest rate, and money is deposited into the account at the end of the specified period. Suppose that a person deposits R dollars m times a year into an account that pays r% interest compounded m times a year for t years. Then the total accumulated at the end of t years is given by For example, suppose that you deposit $500 at the end of each month into an account that pays 4.8% interest per year compounded monthly for 25 years. Then the total money accumulated into the account is.
On the other hand, suppose that you want to accumulate S dollars in t years and would like to know how much money, m times a year, you should deposit into an account that pays r% interest compounded m times a year. The periodic payment is given by the formula.
Design a class that uses the above formulas to determine the total accumulated into an account and the periodic deposits to accumulate a specific amount. Your class should have instance variables to store the periodic deposit, the value of m, the interest rate, and the number of years the money will be saved. Add appropriate constructors to initialize instance variable, functions to set the values of the instance variables, functions to retrieve the values of the instance variables, and functions to do the necessary calculations and output results.
Explanation / Answer
//Main program#include <iostream>
#include <iomanip>
#include "finance.h"
using namespace std;
int main()
{
finance Lisa(500, 6, 20, 0.048);
finance Bill(0, 4, 10, 0.052);
cout << fixed << showpoint << setprecision(2);
cout << "Total accumulated in Lisa's account: "
<< Lisa.totalAccumulated() << endl;
cout << "Periodic payment needed to accumulate 250000 in Bill's account: "
<< Bill.periodicPaymentToAccumulateASum(250... << endl;
system("pause");
return 0;
}
And this is the code that I have, I feel hopelessly lost.
//Main program
#include <iostream>
#include <iomanip>
using namespace std;
void finance(char name, double money=0.0, double interest=0.0, int year=0, int count=0, double output){
if name=bill the
}
void totalAccumulated(){
}
void periodicPaymentToAccumulateASum(int input){
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.