Share
Explore BrainMass

Writing a program to calculate GPA

Write a program to read a student's number, his or her old grade point average, and the old number of course credits (e.g., 31479, 3.25, 66) and to then print these with appropriate labels. Next, read the course credit and grade of four courses - for example, course1Credits = 5.0, course1Grade = 3.7, course2Credits = 3.0, course2Grade = 4.0, and so on.

Calculate
Old # of honor points = (old # of course credits) * (old GPA)
New # of honor points = course1Credits * course1Grade + course2Credits * course2Grade + ...
Total # of new course credits = course1Credits + course2Grades + ...
Current GPA = # of new honor points/# of new course credits

Print the current GPA with an appropriate label. Finally, calculate cumulative GPA = (#of old honor points) + (#of new honor points)/(#of old course credits) + (#of new course credits) and display this label.

Write the program in C++ language.

$2.19