0

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]
3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by ithelp
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.