Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.75 KB | None | 0 0
  1. //Header file, home of the classes
  2.  
  3. #include <string>
  4. using namespace std;
  5. #ifndef STUDENT_H
  6. #define STUDENT_H
  7.  
  8. //Student class, housing the student name, classes, id, gpa, and ways to get/set all those, calculate gpa, as well as search for classes with a
  9. //specified grade
  10. class Student
  11. {
  12.  
  13.  
  14. public:
  15.     //get and set for all attributes except gpa, get for gpa, calculate gpa, find all classes that match user req grade
  16.     Student(); //Constructor, sets defaults to student name, id, and gpa
  17.     //precondition: The student id is already set or has a default value
  18.     //postcondition: This will return the student's id when called
  19.     int GetStudentID() { return StudentID; };
  20.     //Precondition: none
  21.     //Postcondition: you will set the id for the student
  22.     void SetStudentID(int StudentID_) { StudentID = StudentID_; };
  23.     //Precondition: The student name has been set or has a default value
  24.     //PostCondition: It will return the student's name
  25.     string GetStudentName() { return StudentName; };
  26.     //Precondition: none
  27.     //Postcondition: Sets the student's name
  28.     void SetStudentName(string StudentName_) { StudentName = StudentName_; };
  29.     //Precondition: The classes have been filled out for the student
  30.     //Postcondition: Returns the classes the student is taking.
  31.     string GetClasses(string classes[100]);
  32.     //Precondition: None
  33.     //Postcondition: Sets the classes for the student.
  34.     void SetClasses(string Classes_[100]);
  35.     //Precondition: The student's grades have been filled out
  36.     //Postcondition: Retrieves the student's grades
  37.     string GetGrades(char grades[100]);
  38.     //Precondition: None
  39.     //Postcondition: Sets the grades for the student
  40.     void SetGrades(char Grades_[100]);
  41.     //Precondition: The GPA has been set or has a default value
  42.     //PostCondition: Returns the GPA that has been calculated
  43.     float GetGPA() { return GPA; };
  44.     //Precondition: The student grades have been filled.
  45.     //Postcondition: Uses the grades and calculates the GPA the student had
  46.     void CalculateGPA();
  47.     //Precondition: The grades and classes have already been filled out and the user selects a grade to search
  48.     //Postcondition: Searches through the grades for the user selected grade, then matches the grade to the class and returns all classes with the grade
  49.     string ReturnGradeSearch(char Grade_[100], string Classes_[100], char grade);
  50.     //Precondition: The semesters have been set
  51.     //Postcondition: Returns the semesters each class was taken
  52.     string GetSemester(int Semester[100]);
  53.     //Precondition: None
  54.     //Postcondition: sets the semester each class was taken
  55.     void SetSemester(int Semester_[100]);
  56. private:
  57.     //student name, id, classes, grades, semester, gpa
  58.     int StudentID;
  59.     string StudentName;
  60.     string Classes[100];
  61.     char Grades[100];
  62.     int Semester[100];
  63.     float GPA;
  64.  
  65. };
  66.  
  67.  
  68.  
  69. #endif !STUDENT_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement