Write a C++ program that computes the total anticipated future value of the investment at the end of the years allotted
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a C++ program that computes the total anticipated future value of the investment at the end of the years allotted
Welcome to the investment helper! Enter principle amount of your investment: $2500 Enter the interest rate: 6.5 Enter the number of times interest is compounded per year: 12 Enter the number of years of this investment: 10 Your investment of $2500 will grow into $4788.44 at the end of 10 years. Here is another example run of the program: Welcome to the investment helper! Enter principle amount of your investment: $3000 Enter the interest rate: 4.5 Enter the number of times interest is compounded per year: 12 Enter the number of years of this investment: 20 Your investment of $3eee will grow into $7366.34 at the end of 20 years. Submit the program: • If after you compile your program, there is compilation errors, then you need to modify the program according to the error messages. You may need to edit and compile your program multiple times before it compiles successfully Now you can run the program, check to make sure the output is correct. If not, you need to modify the program and recompile and rerun the program Once you are able to successfully run the program with the correct outputs, you are ready to submit the program
Program Documentation Style Description Comments have been added to each group of logically related statements, including each: . . . Variable: . . . . Constants: . . Decision statement Loop statement Group of logically related statement User defined function . . Meaningful names are used unless specified by the program description Variable naming convention is followed No global variable is used User defined functions: . Defined when appropriate Defined in the global declaration section Constant naming convention is followed Defined when appropriate No function should have more than 25 lines of code (exclude white lines and lines only containing curly brackets) Function naming convention is followed the Benga nacior to rand
Correctness . Proper Indentation is used to make the program easier to read. All the decision statements are indented properly. • Defined when appropriate No function should have more than 25 lines of code (exclude white lines and lines only containing curly brackets) Function naming convention is followed . All the loop statements are indented properly Body of the functions are indented Blank lines are used in front of each block of logically related statements Program solves the assigned problem using methods described in program description. Program compiles without errors. Program executes without crashing. Program produces the correct output when tested using different user input. 5
Enput/Output Tests ▷ Run tests Test 1 Test 2 main.cpp x 1 #include <iostream> 2 using namespace std; 3 4 5 ▼ int main() { 6 7 8 H I
Input Output 1 Welcome to investment helper! 2 Enter principle amount of your investment: Enter the interest rate 3 Your investment of $2500.00 will grow into $3917.47 at the end of 1 2 4.5 3 12 4 10 2500 Test 1 match
Output Input 1 Welcome to investment helper! 2 Enter principle amount of your investment: Enter the interest rate 3 Your investment of $3000.00 will grow into $10969.25 at the end of 3000 Test 2 1 2 6.5 3 12 4 20 match