home *** CD-ROM | disk | FTP | other *** search
- // Student.cpp
- #include "student.h"
- float Student::addCourse(int hours, float grade)
- {
- float weightedGPA;
-
- weightedGPA = semesterHours * gpa;
-
- //now add in the new course
- semesterHours += hours;
- weightedGPA += grade * hours;
- gpa = weightedGPA / semesterHours;
- return gpa;
- }
-