I need a little help with the below if statement. What i would like to have happen is for the loop caused by the first if statment to also be conditional to a second if statement that will pause the loop output and require user interaction to either continue displaying the looped information or quit. My thought was to pause the loop after every 12 lines of output and require the user to continue or exit the loop. Any help is greatly apreciated. As you can see below i was not succeful in my attempt. Thanks again.
for (int a = 1; a < months+1; a++)
{
if (a < months){
currInt = principal * interest;
principalPaid = payment - currInt;
principal = principal - principalPaid;
cout << "Payment Number" << "\tPayment Amount" << "\tInterest Paid" << "\tBalance "<< endl;
cout << a << "\t\t$" <<payment << "\t$" <<currInt << "\t\t$" <<principal << endl;
[B]if (a = months+12){
cout << "Would you like to Continue (Y/N)?\n";
cin >> R;
while (R == 'y' || R == 'Y');
return 0;[/B]
}
}
else {
cout << endl;
cout << a << "\t*******Your loan is paid in FULL!!*******" << endl;
}