You are on page 1of 8

GPA Calculator

ALI ALYAFAE | Course Title | Date


INTRODUCTION

The proportion that a student receives in an exceedingly course is beneficial in activity his
understanding of the topics studied; however, once observing the scholar’s entire semester,
mistreatment a mean percentage would cause serious issues. For example, one course might be
price only one credit and nevertheless the student received 100 percent which might raise his
semester average. this can be wherever score Average (GPA) is incredibly useful. Not solely will
it take into result individual course marks, it uses the burden of every course within the
calculation to possess a much better indication of the students’ academic status. touchstone is that
the total amount of grade points that a student earns divided by what number credits it took to
earn them. so as to earn grade points. Evaluation associate 83% in science maybe would take for
the scholar a GPA of 3.67 in this course. to search out the whole grade points the student attained
from that course, you'd merely multiply the GPA by the quantity of credits the course was worth.

I’ll provide C++ code that will be able to calculate the GPA for student regarding mark
entered for every subject, with demonstration of how do that.

PAGE 1
FLOW CHART

PAGE 2
The above flowchart shows the steps of calculating GPA for a specific student, at end it’ll ask the
user if he wish to continue with another student or not.

APPROACH

1- First, the user will input number of semesters.


2- Then inserting number of courses in that semester.
3- So, he will be in loop to inserting course hours and grade for each of them.
4- After that, adding course hours and grade in two different variables.
5- Next, and after finishing that for a specific subject repeat previous steps (3 and 4) until
you reach the number of courses entered by the user.
6- Once done, repeat the previous steps (2 to 5).
7- At the end the program will prompt the GPA result to the student, and ask him, if he /she
wish to continue or not.
8- If yes, start again from step 1, otherwise program will be terminated.

PAGE 3
PROGRAM CODE
#include <iostream>

using namespace std;

int main(void) {

while(1){

int sems,courses,i;

float totalGradePoints = 0.0;

float totalCreditHours = 0.0;

cout<<"Number of semesters completed? "; // asking the number of semesters

cin>>sems; // taking input from the user

for(i = 0; i<sems; i++){ // now iterating till the sems

cout<<"Enter the number of courses taken in each semester? ";

cin>>courses; //and taking the courses

int j;

float Grade,Hours;

for(j=0; j< courses; j++){ // then for each course taking the grade and credit

cout<<"Enter grade in course and credited hours for the course. ";

cin>>Grade;

cin>>Hours;

totalGradePoints += Grade*Hours; // and adding it to total grade

totalCreditHours += Hours; // and total credit}}

float gpa = totalGradePoints / totalCreditHours; // then dividing the total grade with total points
PAGE 4
cout<<"Your gpa for all semesters is: "<<gpa<<endl;

if(gpa>=4){ // using if else to decide the grade

cout<<"Your Grade is Excellent."<<endl;}

else if(gpa>=3){

cout<<"Your Grade is V. Good."<<endl;}

else if(gpa>=2){

cout<<"Your Grade is Good."<<endl;}

else if(gpa>=1){

cout<<"Your Grade is Accepted."<<endl;}

else if(gpa>=0){

cout<<"Your Grade is Fail."<<endl;}

cout<<"print 1 to continue and 0 to stop. "<<endl; // asking the user if he wants to calculate gpa
for

int x; // another student

cin>>x;

if(x== 0){

break;}}

return 0;

PAGE 5
SAMPLE OUTPUTS

PAGE 6
CONCLUSION

In this article, I introduced a software application aimed at facilitating the processing of


research results at the university. The application has been successfully developed, tested, and
works as expected. You can process student results quickly and accurately and present them in the
specific format you need. It uses a command-line approach, is reasonably secure, and enhances
the integrity of the data obtained by using a relational database management system.

This application can greatly automate the processing of student results, reducing time and
accuracy. It's really nice to have some kind of review tool to see where you are in the class. You
can always enter grades into previously completed tasks, calculate weights according to class, and
receive output, even if you haven't completed or received grades yet.

PAGE 7

You might also like