Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Header file, home of the classes
- #include <string>
- using namespace std;
- #ifndef STUDENT_H
- #define STUDENT_H
- //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
- //specified grade
- class Student
- {
- public:
- //get and set for all attributes except gpa, get for gpa, calculate gpa, find all classes that match user req grade
- Student(); //Constructor, sets defaults to student name, id, and gpa
- //precondition: The student id is already set or has a default value
- //postcondition: This will return the student's id when called
- int GetStudentID() { return StudentID; };
- //Precondition: none
- //Postcondition: you will set the id for the student
- void SetStudentID(int StudentID_) { StudentID = StudentID_; };
- //Precondition: The student name has been set or has a default value
- //PostCondition: It will return the student's name
- string GetStudentName() { return StudentName; };
- //Precondition: none
- //Postcondition: Sets the student's name
- void SetStudentName(string StudentName_) { StudentName = StudentName_; };
- //Precondition: The classes have been filled out for the student
- //Postcondition: Returns the classes the student is taking.
- string GetClasses(string classes[100]);
- //Precondition: None
- //Postcondition: Sets the classes for the student.
- void SetClasses(string Classes_[100]);
- //Precondition: The student's grades have been filled out
- //Postcondition: Retrieves the student's grades
- string GetGrades(char grades[100]);
- //Precondition: None
- //Postcondition: Sets the grades for the student
- void SetGrades(char Grades_[100]);
- //Precondition: The GPA has been set or has a default value
- //PostCondition: Returns the GPA that has been calculated
- float GetGPA() { return GPA; };
- //Precondition: The student grades have been filled.
- //Postcondition: Uses the grades and calculates the GPA the student had
- void CalculateGPA();
- //Precondition: The grades and classes have already been filled out and the user selects a grade to search
- //Postcondition: Searches through the grades for the user selected grade, then matches the grade to the class and returns all classes with the grade
- string ReturnGradeSearch(char Grade_[100], string Classes_[100], char grade);
- //Precondition: The semesters have been set
- //Postcondition: Returns the semesters each class was taken
- string GetSemester(int Semester[100]);
- //Precondition: None
- //Postcondition: sets the semester each class was taken
- void SetSemester(int Semester_[100]);
- private:
- //student name, id, classes, grades, semester, gpa
- int StudentID;
- string StudentName;
- string Classes[100];
- char Grades[100];
- int Semester[100];
- float GPA;
- };
- #endif !STUDENT_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement