Data Table

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 32
Reputation: Max_Payne is an unknown quantity at this point 
Solved Threads: 0
Max_Payne's Avatar
Max_Payne Max_Payne is offline Offline
Light Poster

Data Table

 
0
  #1
Oct 20th, 2007
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.

  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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,397
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Data Table

 
0
  #2
Oct 20th, 2007
Have no idea what you want. Care to explain in more detail.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,827
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 117
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: Data Table

 
0
  #3
Oct 21st, 2007
This could be an array bound overflow problem.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC