Lab #2 - Investment Calculator: Assigned Date: End of Week 4 Due Date: Beginning of Week 5
This document provides instructions for Lab #2, which involves writing a C++ program to calculate the monthly deposit needed to reach an investment goal given the amount needed, interest rate, and duration in months. Students are to work independently to solve the problem and may seek help from the professor or tutors. The program must take user input for the amount needed, interest rate, and duration in months, then calculate and display the required monthly deposit to two decimal places. Additional requirements include complying with coding standards, having the program be compilable and executable, including header information, naming the source file lab2.cpp, and submitting both code and a flowchart.
Lab #2 - Investment Calculator: Assigned Date: End of Week 4 Due Date: Beginning of Week 5
This document provides instructions for Lab #2, which involves writing a C++ program to calculate the monthly deposit needed to reach an investment goal given the amount needed, interest rate, and duration in months. Students are to work independently to solve the problem and may seek help from the professor or tutors. The program must take user input for the amount needed, interest rate, and duration in months, then calculate and display the required monthly deposit to two decimal places. Additional requirements include complying with coding standards, having the program be compilable and executable, including header information, naming the source file lab2.cpp, and submitting both code and a flowchart.
Assigned Date: End of Week 4 Due Date: Beginning of Week 5
The coded solution to the following problem is to be done by you and only you. You may ask for help only from the professor and the tutors, and no one else. You may use your texts, notes, online tutorials, etc., but the code must be your own. Bear in mind that the professor and tutor are helping you with your C++ problem and not writing your program! If you have trouble compiling or debugging your code, see the professor or tutors as soon as possible. If none of us are available, you may email your question to your professor directly.
Problem Statement
Suppose you have an investment goal, and you need to map out a plan for how to reach it. In other words, you know a future value F that you want to reach, by making N periodic payments P into an account that earns interest i.
For example, suppose youre saving for a down payment on a house. You expect to buy in five years, and youll be looking in the $250,000 range. You need to make at least a 10% down payment, plus $2,500 for closing costs. In this case the final amount youre saving for would be 10% of $250,000 + $2,500 = $27,500. If your money fund (where you are keeping your money) pays 5.5%, posted and compounded every month, you would need to save about $400 per month ($399.24 to be exact) to meet your goal.
Write a program that will take three inputs: the amount the user is saving for, the interest rate of the savings account, and the amount of time in months until the purchase. Your program should then calculate the amount the user should deposit into the savings account every month in order to reach their goal.
One of your tasks is to figure out (find) the formula.
Example 1:
Enter Amount Needed: $27500 Enter Interest Rate: 5.5 Enter Duration (in months): 60
Monthly Deposit Amount: $399.24
Example 2:
Enter Amount Needed: $5000 Enter Interest Rate: 8 Enter Duration (in months): 24
1. Your program style must comply with the Programming Coding Standard. 2. Your program must be compilable and executable according to the specification. 3. You must include header information in your source code. 4. Your monthly deposit must be displayed in 2 decimal places. 5. Name your source file lab2.cpp. 6. You must submit a softcopy of your program on Canvas. 7. You must submit a hardcopy of your flowchart along with your program.