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

An interesting program. The program needs to be in c++. Thank you Part 2: An int

ID: 674452 • Letter: A

Question

An interesting program. The program needs to be in c++. Thank you

Part 2: An interesting program Problem description An investor has the opportunity to invest a minimum of $10,000 in an investment. We want to write a program to help him/her determine the future value of the investment. The program will ask the user to enter the investment amount, the annual interest rate, and the number of months of the investment to be used as inputs in calculating the future value of the investment. Your program must calculate compounded interest monthly. This is done in the loop in the pseudo code below. Make sure you read and understand the pseudo code before you start writing your application. Write the source code for a program that implements the pseudo code algorithm given below. Save the source code in a file named Lab6_Exercise2.cpp. Pseudo code: Ask the user for the "initial investment amount" Get a minimum "initial investment amount" of $10,000 from the user Ask the user for the "annual interest rate" Get a non-negative "annual interest rate" from the user Ask the user for the “number of months" of the investment Get a non-negative "number of months" from the user Calculate the "monthly interest rate" by dividing the "annual interest rate" by 12 and then dividing the resulting value by 100 (make sure you don't get truncation of results here) Save the "initial investment amount" into "investment balance" Repeat for the "number of months" of the investment (note that 1. and 2. are part of the loop) 1. Calculate the "interest earned" by multiplying the "investment balance" by the "monthly interest rate" 2. Increase the value of "investment balance" by the "interest earned" Display a message indicating the future value of the investment stored in "investment balance"

Explanation / Answer

#include<iostream.h>

#include<conio.h>

void main()

{

int initail_invest;

int airate;

int months;

int mirate;

int investBalance;

int iearned;

cout<<"please enter the initial investment amount";

cin>>initial_invest;

if(initial_invest <10000)

{

cout<<"please renenter the initial investment amount greater than $10000";

cin>>intial_invest;

}

cout<<"please enter annual interest rate";

cin>>airate;

if(airate< 0)

{

cout<<"please reenter the positive annual interest rate";

cin>>airate;

}

cout<<"For how many months would you like to invest?";

cin>>months;

if(months<0)

{

cout<<"please reenter positive number of months";

cin>>months;

}

mirate=airate/12;

mirate=mirate/100;

cout<<"the monthly investment rate is: %d" <<mirate;

investBalance=inital_invest;

for(i=1;i<months;i++)

{

iearned = investBalance * mirate;

investBalance += iearned;

}

cout<<"The future value of investment %d"<< investBalance;

getch(0);

}

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