Answer:
The code is given in C++ below
Explanation:
#include <iostream>
using namespace std;
int main()
{
float fv,pv,r,k,n,pmt,totalmoneyinvested;
pv=1000.00;
r=6/100;
k=12; //The value of k should be 12 for monthly installments
n=45;
pmt=250;
totalmoneyinvested=pv+(pmt*12*45); //The total money you invested
fv=pv*(1+r/k)*n*k+pmt*((1+r/k)*n*k-1)*(1+r/k)*r/k;
cout<<"Initial Investment:"<<" $"<<pv;
cout<<"\nRate Of Return:6%";
cout<<"\nLength of Time:"<<n<<"year";
cout<<"\nMonthly Payment:"<<" $"<<pmt;
cout<<"\nFinal Amount:"<<" $"<<fv;
cout<<"\nThe Money You Invested Is $"<<totalmoneyinvested<<" And The Final Amount Is $"<<fv;
return 0;
}