I made this Data Table.
The problem is when the outputs are different it will change the shape of the Table.
I need some tips on how can i fix this problem.
[INDENT]double sum = 0;
for ( int j = 0 ; j < 5 ; j++ )
sum += myClass[j].getTotalToPay();
cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" <<endl;
cout << " x First | ID | Pay-Rate | Worked-Hours | Over-Time | TotalPay x" << endl;
cout << " x Name | Number | | ( Hours ) | (Hours) | ( $ ) x" << endl;
cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" <<endl;
for ( int i = 0 ; i < 5 ; i++ )
{
cout << " " << myClass[i].getName()
<< setw(9) << myClass[i].getNumber()
<< setw(11) << myClass[i].getRate()
<< setw(14) << myClass[i].getWorked()
<< setw(17) << myClass[i].getOverTime()
<< setw(13) << "$" << myClass[i].getTotalToPay() << endl;
}
cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" << endl;
cout << " Totals x $" << sum << endl;
cout << " xxxxxxxxxxxxxx" << "\n\n\n";
[/INDENT]