Can anyone help me - The screen never pauses or stays put (after the end while) for the last 3 lines of code to display and the line right above the end while -totalinterestpd is not being written to the outfile
I'm stumped.
while (MonthlyPayment <= LoanAmt)
{
MonthlyInterest = (ConvertedRate/NoOfMonths) * LoanAmt;
TotalInterestPd += MonthlyInterest;
LoanAmt = LoanAmt - (MonthlyPayment - MonthlyInterest);
outfile << setfill(' ') << right << setw(15)
<< "Interest Amount" << setw(20) << "Loan Balance" << endl;
outfile << setw(15) << MonthlyInterest << setw(20)
<< LoanAmt << endl;
outfile << setfill(' ') << left << setw(10)
<< "Total interest paid: $ " << TotalInterestPd << endl;
} //end while
cout << "Last payment Amount less than Loan Amt $ " << LoanAmt << endl;
cout << "Last Payment amount is: $ " << LoanAmt << endl;
cout << "Total amount of interest paid: $ " << TotalInterestPd << endl;
// system ("pause");
return 0;
}