Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <cstring>
  4. #include <string>
  5. #include <iomanip>
  6. #include <cstdlib>
  7. #include "student.h"
  8.  
  9. string student::setID(string id)
  10. {
  11. stuID = id;
  12. }
  13.  
  14. string student::setName(string name)
  15. {
  16. // Setters shouldn't do side effects
  17. cout << name << endl;
  18. stuName = name;
  19. cout << stuName << endl;
  20. }
  21.  
  22. int student::setHPScores(int hpScores[])
  23. {
  24. // For "reasons", ptrdiff_t is probably the best choice for
  25. // iterating over an array. Using the usually suggested
  26. // unsigned type of size_t inhibits certain optimizations.
  27. for (int i=0;i<10;i++)
  28. {
  29. stuHomeworkParticipationScores[i]=hpScores[i];
  30. cout << hpScores[i] << endl;
  31. }
  32. }
  33.  
  34. int student::setTestScores(int tScores[])
  35. {
  36. for (int i=0;i<4;i++)
  37. {
  38. stuTestScores[i]=tScores[i];
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement