You are on page 1of 15

OOP Project Report

On
CGPA Calculator

in
COMPUTER SCIENCE AND ENGINEERING

By

Irfan Ali

2020-Cuvas-0228

Cholistan University of Veterinary and Animal Sciences


Lovely Professional
University South Punjab
(Pakistan)
 Table of contents.
INTRODUCTION

OOP is a high-level programming language with annotated, object-


oriented, dynamic vocabulary. OOP emphasizes the ability to read simple,
easy-to-learn syntax and therefore reduces program maintenance costs.
Often, programmers fall in love with OOP because of the increased
productivity it provides. Built-in modules (written in C++) that provide
access to system functionality such as File I / O that would otherwise be
inaccessible to OOP programmers, as well as modules written in OOP that
are used daily Provides standard solutions to many programming
problems.OOP installers for the Windows platform usually include the
entire standard library and often include several additional components.
Both GPA (Grade Point Average) and CGPA (Cumulative Grade Point
Average) are used across several boards and universities for calculating,
assessing, and grading academic performance. This project will describe
the GPA and CGPA calculating system. Its functionalities are to first take
the credit and subject’s points of the subjects. And we give semester wise
GPA in it and calculating CGPA. It is very easy to use and get GPA and
CGPA from this project.
In this project we have made a GUI interface to calculate CGPA by
taking all the details from the student like Grades, Credits and subjects for
different semesters. In this GUI we have also shown a separate area with
grading points which will tell user about how points are being assigned to
each and every grade. This GUI project will help many universities and
Colleges as it is simple to use and its User Interface is very user friendly.
OBJECTIVE

For university students keeping track of their cgpa is pretty important so that
they can keep a balance between their academics and co-curricular activities
along with good marks thus its much difficult to keep on calculating again and
again the types and cgpa and hence this CGPA calculator helps to instantly
calculate the gpa and cgpa of a student based on certain inputs.
We have created a very user friendly project so that user can easily run through
it without any difficulty.

The major purpose of the project is to help students keep track of their grades
and markings. Also they can predict how much they have to score to keep the
desired cgpa for the year.
Calculation of GPA and cgpa have become much more easier through this
project the student are easily able to know the grading system.

It is very difficult work to calculate GPA and CGPA. We have to make a


lot of math in have to do. Due to which the answer is sometimes wrong.
We have solved this problem in this project. This project is used to
overcome the entire problem which are facing currently. We can easily
calculate GPA and CGPA with the help of formula in this project.

Problem Statement
This project will describe the GPA and cgpa calculating system. The code
should start by asking the user the number of semesters he has completed, Then
the number of courses taken each semester, and based on that, the user will start
their admission. Grades in each course with the number of credits for this
course. The rating system is shown below.
Methodology
Your CGPA calculated dividing the sum of the grade points earned by the total
credit value of courses you have attempted.Useing IDE Code Block for
compiling C++ language code. Main function calling the desired output and
using in this Project object Oriented Programming concepts
Main Features
Option= 1
Calculate GPA (Grade Point Average)
Option= 2
Calculate CGPA (Cumulative Grade Point Average)
Option= 3
Exit from the user interface

Motivation
I worked on the cgpa calculation project. Developing the project was indeed a
tough task for but we enjoyed to make this project Moreover we have also
learned that hardworking important role in accomplishing any task.

Challenges
Challenge 1
The biggest challenge for me was to come up with a formula for extracting GPA
from grade points and credit hours.
Challenge 2
GPA and Cgpa creating to separate menu and was to calculate.
Challenge 3
Creating a box main menu ASCCI values.

Header files
Our project is based on these Header files.

1. #include<iostream.h>

It contains function prototypes for the standard input and standard


output functions.

2. #include<stdio.h>
#' is a symbol that says "next instruction is for pre-processor, not compiler".
#include <stdio.h> does absolutely nothing more than take contents of the file
named "stdio.h" and stick it inside your source file. Simple as that.
3. #include<string>

It contains function prototypes for C-style string processing functions


Contains the definition of class string from the C++ Standard Library
4. #include <stdlib.h>
C Standard General Utilities Library
This header defines several general purpose functions, including dynamic
memory management, random number generation, communication with the
environment, integer arithmetic’s, searching, sorting and converting.

BUILDIN FUNCTION
 Cin

Cin is an object of class Istream that represents the standard input stream.

 Cout

Cout is an object of class ostream that represents the standard output stream.

USER DEFINE FUNCTION


1. void calculate ()
Source code
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
class Profile
{
public :
string name;
string rollno;
void getdata()
{
system("color 37");
cout<<"Enter your name\n";
cin>> name;
cout<<"Enter your roll no\n";
cin>> rollno;
}

};
class GPA: public Profile
{
public :
void calculate()
{

int q;
system("cls");
system("color 71");
printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
201,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,187);
printf(" %c GPA Calculating %c\n",186,186);
printf(" %c %c\n",186,186);
printf(" %c How many subject's points do you want to calculate? :
%c\n",186,186);
printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
202,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,188);

cin>>q;

float credit [q];


float point [q];

cout<<endl;
for(int i=0;i<q;i++)
{
cout<<"Enter the credit for the subject "<<i+1<<": ";
cin>>credit[i];
cout<<endl;
cout<<"Enter the point of the subject "<<i+1<<": ";
cin>>point[i];
system("color 31");
cout<<"-----------------------------------\n\n"<<endl;
}

float sum=0;
float tot;
for(int j=0;j<q;j++)
{
tot=credit[j]*point[j];
sum=sum+tot;
}

float totCr=0;
for(int k=0;k<q;k++)
{
totCr=totCr+credit[k];
}

cout<<"\n\n\nTotal Points: "<<sum<<" . Total Credits: "<<totCr<<" .Total


GPA: "<<sum/totCr<<" ."<<endl;

sub:
int inmenu;
cout<<"\n\n\n1. Calculate Again"<<endl;
cout<<"2. Exit This App \n\n"<<endl;
cout<<"Your Input: "<<endl;
cin>>inmenu;

switch(inmenu)
{
case 1:
calculate();
break;

case 2:
exit(EXIT_SUCCESS);

default:
cout<<"\n\nYou have Entered Wrong Input!Please Choose
Again!"<<endl;
goto sub;
}
}

};

class CGPA: public Profile {


public:
void calculate()
{
system("color 80");
system("cls");
int l;

printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
201,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,187);
printf(" %c Calculate CGPA %c\n",186,186);
printf(" %c %c\n",186,186);
printf(" %c How many semester results do you want input? :
%c\n",186,186);
printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
202,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,188);
cin>>l;
cout<<"\n\n"<<endl;
float semrs[l];
int i;

for(i=0;i<l;i++)
{
cout<<" Enter Semester "<<i+1<<" Result(GPA): ";
cin>>semrs[i];
cout<<"\n"<<endl;
}

float semtot=0;
for(int j=0;j<l;j++)
{
semtot=semtot+semrs[j];
}
system("color f");
cout<<"******** Your CGPA is "<<semtot/l<<" **********"<<endl;
if(semtot/l<2.5)

cout << "you have to take more then 3.0 cgpa in next semester otherwise you
will be dropped";

else

cout << "Congrats you are qualified in next semester";


system("color a1");

sub:
int inmenu;
cout<<"\n\n\n1. Calculate Again"<<endl;
cout<<"2. Exit This App \n\n"<<endl;
cout<<"Your Input: "<<endl;
cin>>inmenu;

switch(inmenu)
{
case 1:
calculate();
break;
case 2:
exit(EXIT_SUCCESS);

default:
cout<<"\n\nYou have Entered Wrong Input!Please Choose
Again!"<<endl;
goto sub;
}

};

int main()
{

GPA gpa;

CGPA cgpa;

system("cls");
int input;
system("color 34");
printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
201,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,187);
printf(" %c MENU: %c\n",186,186);
printf(" %c 1. Calculate GPA (Grade Point Average)
%c\n",186,186);
printf(" %c 2. Calculate CGPA (Cummulative Grade Point Average)
%c\n",186,186);
printf(" %c 3. Exit Application %c\n",186,186);
printf(" %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c
%c %c %c %c %c %c %c %c %c %c %c %c %c\n",
202,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,2
05,205,205,205,205,205,205,205,205,205,205,205,188);
sub:
cout<<"Enter your choice: ";
cin>>input;
switch(input)
{
case 1:
gpa.getdata();
gpa.calculate();
break;

case 2:
cgpa.getdata();
cgpa.calculate();
break;
case 3:
exit(EXIT_SUCCESS);
break;
default:
cout<<"You have entered wrong input.Try again!\n"<<endl;
goto sub;
break;
}
}

Screenshots of gui
Save button to save data
zz
Text box as a Resets all data Calculates tgpa
communicator

Gives remarks based on cgpa


GUI AS A WHOLE

RESULT

Through this project the students would be able to easily calculate their
tgpas and cgpa in a faster and easier manner and as developers we were
also able to learn the features of python programming language and also
understand the working of the graphical user interface how to use the
tkinter library to make one and the SQLite3 for the database which act as a
storage system in the backend for our project.
We were also able to come up with certain new ideas which we have
implemented in our project. By making this project we have explored the
vast field of python programming language and were able to use our
theoretical knowledge in a practical project which has helped us in
understanding the concepts far better than any bookish knowledge.

Load Button functionality

Reset Button functionality


REFERENCE
Books:
1. Buku Bahasa Pemrograman

2. Bahasa C++

Websites:
 https://gist.github.com/
 https://google.com/
 https://Academia.edu.com/

You might also like