Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include "classes.h"
  2.  
  3.  
  4. Student::Student(unsigned int id, std::string fio) {
  5. this->id = id;
  6. this->fio = fio;
  7. }
  8.  
  9. void Student::add_group(Group* group) {
  10. this->group = group;
  11. }
  12.  
  13. void Student::add_mark(int mark) {
  14. this->marks.push_back(mark);
  15. }
  16.  
  17. float Student::average() {
  18. int sum = 0;
  19. for (auto x : this->marks)
  20. sum += x;
  21. return (sum / this->marks.size());
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement