944,092 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2136
  • C++ RSS
Oct 20th, 2007
0

Data Table

Expand Post »
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.

cpp Syntax (Toggle Plain Text)
  1. [INDENT]double sum = 0;
  2.  
  3. for ( int j = 0 ; j < 5 ; j++ )
  4. sum += myClass[j].getTotalToPay();
  5.  
  6. cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" <<endl;
  7. cout << " x First | ID | Pay-Rate | Worked-Hours | Over-Time | TotalPay x" << endl;
  8. cout << " x Name | Number | | ( Hours ) | (Hours) | ( $ ) x" << endl;
  9. cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" <<endl;
  10.  
  11.  
  12. for ( int i = 0 ; i < 5 ; i++ )
  13. {
  14. cout << " " << myClass[i].getName()
  15. << setw(9) << myClass[i].getNumber()
  16. << setw(11) << myClass[i].getRate()
  17. << setw(14) << myClass[i].getWorked()
  18. << setw(17) << myClass[i].getOverTime()
  19. << setw(13) << "$" << myClass[i].getTotalToPay() << endl;
  20. }
  21. cout << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" << endl;
  22. cout << " Totals x $" << sum << endl;
  23. cout << " xxxxxxxxxxxxxx" << "\n\n\n";
  24. [/INDENT]
Last edited by Max_Payne; Oct 20th, 2007 at 8:04 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Max_Payne is offline Offline
32 posts
since Oct 2007
Oct 20th, 2007
0

Re: Data Table

Have no idea what you want. Care to explain in more detail.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Oct 21st, 2007
0

Re: Data Table

This could be an array bound overflow problem.
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: reading file I/O
Next Thread in C++ Forum Timeline: reading data from file to vector





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC