ok my next question is how would I put a empty space between my output, right no
ID: 3549634 • Letter: O
Question
ok my next question is how would I put a empty space between my output, right now it prints 6 rows but how do i add a space or a " " for example
row1
row2
row3
blank space
row22
row 23
row24
for (i=1; i<=months; i++)
{
if (i<=3 || i>=(months-2))
{
accInt = (loanAmount) * (monRate); // accured interest
principal = monPayment - accInt; // the new princiapal
lastBalance = loanAmount - monPayment + accInt; //the last balance from the loan amount
sumInterest += accInt;
if (i==months)
lastBalance = 0; // if its the last month it has to equal zero
// output of all the loan information
myOut << fixed << setprecision(0) << i <<" ""$"<< fixed<<setprecision(2)<<accInt<<" ""$"<<fixed<<setprecision(2)<<principal<<" ""$"<<fixed<<setprecision(2)<<lastBalance<<" ";
loanAmount = lastBalance; //updats new loan amount
}
}
myOut <<" " <<"Total interest paid: $" <<fixed<<setprecision(2)<<sumInterest;
Explanation / Answer
add
if (i % 3 == 0)
cout << " ";
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.