Guest User

Untitled

a guest
Nov 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. // File: student.h
  2. // Purpose: Header for declaration of student record class and associated functions.
  3. #ifndef __student_h_
  4. #define __student_h_
  5. #include <iostream>
  6. #include <string>
  7. #include <vector>
  8. class Student {
  9. public:
  10. // ACCESSORS
  11. const std::string& first_name() const { return first_name_; }
  12. const std::string& last_name() const { return last_name_; }
  13. const std::string& id_number() const { return id_number_; }
  14. double hw_avg() const { return hw_avg_; }
  15. double test_avg() const { return test_avg_; }
  16. double final_avg() const { return final_avg_; }
  17. bool read(std::istream& in_str, unsigned int num_homeworks, unsigned int num_tests);
  18. void compute_averages(double hw_weight);
  19. std::ostream& output_name(std::ostream& out_str) const;
  20. std::ostream& output_averages(std::ostream& out_str) const;
  21. private: // REPRESENTATION
  22. std::string first_name_;
  23. std::string last_name_;
  24. std::string id_number_;
  25. std::vector<int> hw_scores_;
  26. double hw_avg_;
  27. std::vector<int> test_scores_;
  28. double test_avg_;
  29. double final_avg_;
  30. };
  31. bool less_names(const Student& stu1, const Student& stu2);
  32. bool less_avg(const Student& stu1, const Student& stu2);
  33. #endif
Add Comment
Please, Sign In to add comment