Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design a class that usese the above formulas to determine the total accumulated

ID: 3624713 • Letter: D

Question

Design a class that usese 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, function to set the value of the instance variable, function to retrive the values of the instance variables, and function to do the necessary calculation and output result.

by C++

Explanation / Answer

So, We should start with a header file: retirement.h #include #include using namespace std; #include #ifndef _RETIREMENT_H_ #define _RETIREMENT_H_ class retirement{ private: //all variables are private(encapsulation) float interest, deposit; double principal, accumulation; int m, years; public: //constructors retirement( double p, int y,float i,int mu,float d) : interest(i), m(mu), years(y), principal(p), deposit(d) {} retirement( double p, int y,float i, int mu ) : interest(i), m(mu), years(y), principal(p), deposit(0) {} retirement( double p, int y,float i) : interest(i), m(0), years(y), principal(p), deposit(200) {} retirement( double p, int y ) : interest(.05), m(0), years(y), principal(p), deposit(200) {} retirement( double p ) : interest(.05), m(0), years(30), principal(p), deposit(200) {} retirement() : interest(.05), m(0), years(30), principal(2500), deposit(200) {} ~retirement(){ //cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote