Hey Everyone! First time posting...still very new to this programming game! :D
Anywho, this is a payroll program, and I want it to output into nice neat columns. I've monkeyed around a lot with the setw (as that's the only way I can think of to space thing besides the " " way. Any help would be much appreciated! This is for an assignment btw.
It helps if the code is laid out in an easy-to-read manner. Sometimes splitting the output statement over multiple lines like this can make it easier to read:
Though you might consider this, use left-align for the names and right-align for the numbers. That will change the layout, so adjust the column headings accordingly.
1 2 3 4 5 6 7 8 9 10 11 12
cout << fixed << setprecision(2); // need once only
cout << left
<< setw(10) << fName[j]
<< setw(10) << lName[j]
<< right
<< setw(10) << hourWork[j]
<< setw(10) << hourRate[j]
<< setw(10) << gp[j]
<< setw(10) << taxamt[j]
<< setw(10) << netpay[j]
<< endl;