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]

Have no idea what you want. Care to explain in more detail.

This could be an array bound overflow problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.