Question
***IN C++ Problem 3: Retirement Calculator Once you have started your first full-time employment, you should start saving for retirement. Because of compound interests, even
***IN C++
Problem 3: Retirement Calculator Once you have started your first full-time employment, you should start saving for retirement. Because of compound interests, even a small amount saved early can grow significantly if interest is accrued over a long time period. To illustrate the power of compound interests, you will build a simple retirement calculator that will take the following input from a user: P: principal / present value r: interest rate t: number of years the money will be left in the account Based on these user inputs, retirement savings (RS) are calculated as follows: RS = P x (1 + r)t Write a program that prompts the user for the above input values. The program should pass these values to a function, retirementSavings() compoundCalc(), that computes and returns the future value of the retirement account after t years. The program should display that value to the user. Implement function compoundCalc() in its own .cpp file and write an appropriate header file. The function should take as input values for p, r and t, in this order. Sample Run 1 (user prompt to enter P): 1000 (user prompt to enter r as a decimal): 0.025 (user prompt to enter t): 20 Your retirement savings will be $1638.62 Sample Run 2 (user prompt to enter P): 1000 (user prompt to enter r): 0.025 (user prompt to enter t): 40 Your retirement savings will be $2685.06 Submission instructions Your submission must include three files: retirementCalc.cpp (this file includes main()), compoundCalc.cpp (this file includes compoundCalc()), and compoundCalc.h Make sure your program compiles and runs on the SoC Linux machines; the autograder automatically assigns 0 points to programs that do not compile. Your program must produce output formatted as shown in the above sample runs, e.g.: Your retirement savings will be $1638.62 Code style (proper indentation, consistency, readability, use of comments, etc.) will be considered when grading your submission
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started