Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELAGAVI, KARNATAKA

MINI-PROJECT REPORT
on
CGPA Calculator using C++

Bachelor of Engineering
in
Information Science & Engineering

Submitted by
Chitrashree A S 1SG22IS017

Dhanya D S 1SG22IS026

Drushya Nanaiah
1SG22IS028

Keerthana K
1SG22IS048

Under the guidance of


Prof. Gayathri R
Assistant Professor
Dept. of I.S.E, S.C.E

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING


SAPTHAGIRI COLLEGE OF ENGINEERING
Bengaluru-57
2022-23
SRISRINIVASAEDUCATIONALANDCHARITABLETRUST®

SAPTHAGIRI COLLEGE OF ENGINEERING


(Affiliated to Visvesvaraya Technological University, Belagavi and Approved by AICTE, New Delhi)
(Accredited by NAAC with “A”grade)(NBA Accredited-CSE,
ECE,EEE,ISE,ME) (An ISO9001:2015 & ISO14001:2015 Certified)

Department of Information Science & Engineering

CERTIFICATE

This is to certify that the Mini-Project work entitled CGPA Calculator a bonafide work carried out by
Chitrashree A S 1SG22IS017 Dhanya D S 1SG22IS026 Drushya Nanaiah 1SG22IS028 Keerthan K
1SG22IS048 in partial fulfillment for the award of the degree of Bachelor of Engineering in Information
Science and Engineering of the Visvesvaraya Technological University, Belagavi during the year 2022-23.
It is certified that all corrections/suggestions indicated for Internal Assessment have been incorporated in the
Report deposited in the departmental library. The Project has been approved as it satisfies the academic
requirements in respect of the Mini-Project work prescribed for the Bachelor of Engineering Degree.

Signature of the Guide Signature of the HOD


Prof. Gayathri R Dr. H R Ranganatha
Assistant Professor Head of Dept. ISE

II
ABSTRACT

CGPA refers to the cumulative grade point average which translates to the
total of all your credit points.This system helps in assessing the overall academic performance of a
student. Although the evaluation criteria may vary from one country to another, the CGPA system is
among the most common evaluation way. Hence it becomes important to understand how to calculate
CGPA in engineering.

In the CGPA system, grades are allotted for a specific bracket of marks. For instance, 90-95 marks
bracket is allotted to grade A. Based on the grade points, the total aggregate is calculated. This means
that all your grades are combined and then they are divided by the total subjects that you undertook
in that semester. Engineering students can also convert CGPA to percentage, CPI to percentage and
CGPA to marks to get clarity.

Awarding grades to students will help them in analyzing their strengths and weaknesses.

Having a certain marks bracket for grades also ensures that students are not discouraged and feel
motivated when they fall in a good bracket. This will help them in putting in more effort.

CGPA ensures that students don’t feel the pressure to score certain marks, such a competition tends
to shift the focus on marks rather than learning.

It also helps the universities in accurately analyzing where one stands in comparison to the
other applicants.

III
ACKNOWLEDGEMENT

Any achievement depends on the individual efforts but on the guidance, encouragement and co-
operation of intellectuals, elders and friends. A number of personalities have helped us. We would like
to take this opportunity to thank them all.

We would take this opportunity to express our heart-felt gratitude to Sri. G. Dayanand,
Chairman, and Dr. H Ramakrishna, Principal, Sapthagiri College of Engineering, Bengaluru for
providing the necessary infrastructure to complete this mini-project.

Our deep sense of gratitude to Dr. H.R. Ranganatha, Head of the Department, Information
Science and Engineering, Sapthagiri College of Engineering, Bengaluru, for his constant support and
encouragement.

We wish to express sincere thanks to our guide Prof. Gayathri R, Assistant Professor,
Department of Information Science and Engineering, Sapthagiri College of Engineering, Bengaluru for
helping us throughout and guiding us from time to time.

We also extend our sense of gratitude and sincere thanks to all the faculty members and non-
teaching staff members of Department of Information Science and Engineering, Sapthagiri College of
Engineering, Bengaluru who have helped us with their views and encouraging ideas.

We are in debt to our Parents, siblings and friends for being an epitome of support system
throughout our life and being with us through our thick and thin situations.

Chitrashree A S 1SG22IS017
Dhanya D S 1SG22IS026
Drushya Nanaiah 1SG22IS028
Keerthana K 1SG22IS048

IV
CONTENTS:

1. INTRODUCTION

1.1 Overview 1

1.2 Objectives 2

1.3 Problem Statement 3

2. INTRODUCTION TO C++ 4

2.1 Characteristics of C++ 5

2.2 Header files 6

2.3 Condition statements 7

3. IMPLEMENTATION

3.1 C++ Source Code 8

4. SNAPSHOTS 10

5. CONCLUSION 13

6. REFERENCES 14

V
CGPA Calculator using C++

CHAPTER 1

INTRODUCTION

1.1. Overview

CGPA refers to the cumulative grade point average which translates


to the total of all your credit points.This system helps in assessing the overall
academic performance of a student. Although the evaluation criteria may vary
from one country to another, the CGPA system is among the most common
evaluation way. Hence it becomes important to understand how to calculate
CGPA in engineering.

In the CGPA system, grades are allotted for a specific bracket of marks. For
instance, 90-95 marks bracket is allotted to grade A. Based on the grade points,
the total aggregate is calculated. This means that all your grades are combined
and then they are divided by the total subjects that you undertook in that
semester. Engineering students can also convert CGPA to percentage, CPI to
percentage and CGPA to marks to get clarity.

Awarding grades to students will help them in analyzing their strengths and
weaknesses.

Having a certain marks bracket for grades also ensures that students are not
discouraged and feel motivated when they fall in a good bracket. This will help
them in putting in more effort.

CGPA ensures that students don’t feel the pressure to score certain marks, such
a competition tends to shift the focus on marks rather than learning.

It also helps the universities in accurately analyzing where one stands in


comparison to the other applicants.

Department of ISE, SCE 2023-24 Page 1


CGPA Calculator using C++

1.2Objective of Project

Cumulative Grade Point Average (CGPA) is a common evaluation metric that measures the
academic achievements of a candidate. The CGPA awards grades A, B, C, D, E & F denoting the
academic performance of a candidate. The CGPA scores are calculated using Semester Grade
Points and Credits earned towards a subject. The CGPA provides an overall performance
overview of a candidate. Whereas the Semester Grade Point Average scores evaluate the
performance of a candidate for a particular semester. The Cumulative Grade Point Average
(CGPA) represents the average GPA grade a student achieves throughout their entire university
or college course. Calculating CGPA involves summing the GPA (Grade Point Average) of the
student across all semesters and then dividing it by the total credit hours. Achieving a high
CGPA necessitates obtaining good GPA scores in individual semesters. Credits: Credits against
a subject are an important requirement when need to calculate CGPA scores. Credit Scores
earned towards a subject are the amount of work the student has put in against that particular
subject. The credits are calculated by taking into account the total hours spent on classwork and
homework per week. The formulae to find out credit score is:
Credit Score = (1 hour of Classwork + 2 hours of homework) per week multiplied by 15 weeks
per semester is equal to 1 Credit Score.So a 4 credit score would include, 4 hours of Classwork +
8 hours of homework per week multiplied by 15 weeks per semester is equal to a 4 Credit Score.
GPA: Grade Point Average more commonly referred to as GPA are letter grades that are
awarded to students based on their academic performance in each subject. The letter grades are
mapped to a grade point scale used to calculate the Semester Grade Point Average of students at
the end of each semester. While there are multiple variations of the Grade Point Average Scale.
In India, most universities follow the 10 Grade Point Average Score and we will
be doing the same.

Department of ISE, SCE 2023-24 Page 2


CGPA Calculator using C++

1.2. Problem Statement

Problem scenario:
Cumulative Grade Point Average (CGPA) is a common evaluation metric that measures the
academic achievements of a candidate. The CGPA awards grades A, B, C, D, E & F denoting the
academic performance of a candidate. The CGPA scores are calculated using Semester Grade Points and
Credits earned towards a subject. The CGPA provides an overall performance overview of a candidate.
Whereas the Semester Grade Point Average scores evaluate the performance of a candidate for a
particular semester

Proposed Solution:
Let us understand the essential components that are needed to calculate CGPA
online.
Credits: Credits against a subject are an important requirement when need to calculate CGPA scores.
Credit Scores earned towards a subject are the amount of work the student has put in against that
particular subject. The credits are calculated by taking into account the total hours spent on classwork
and homework per week. The formulae to find out credit score is:
Credit Score = (1 hour of Classwork + 2 hours of homework) per week multiplied by 15 weeks per
semester is equal to 1 Credit Score.So a 4 credit score would include, 4 hours of Classwork + 8 hours of
homework per week multiplied by 15 weeks per semester is equal to a 4 Credit Score.

Department of ISE, SCE 2023-24 Page 3


CGPA Calculator using C++

CHAPTER 2
INTRODUCTION TO C++

C++ is a programming language that has left an indelible mark on the software development landscape.
Emerging from its predecessor, the C language, C++ was conceived by Bjarne Stroustrup in the early
1980s. Stroustrup's vision was to create a language that not only retained the efficiency and control of C
but also introduced the paradigm of object-oriented programming (OOP). This marriage of imperative
and OOP features has enabled developers to build complex and scalable applications, encapsulating data
and behavior within coherent classes while harnessing the speed and optimization of low-level
programming.

One of C++'s defining characteristics is its emphasis on giving programmers control over memory
management. This control, crucial for optimizing resource usage in performance-critical applications,
sets C++ apart from languages with automatic memory management. By enabling manual memory
allocation and deallocation, C++ empowers developers to finely tune their programs for maximum
efficiency. However, this power also demands responsibility to manage memory correctly, making C++
a choice for experienced programmers seeking optimal performance in applications ranging from real-
time systems to high-performance computing.

The impact of C++ reaches far and wide across various industries. In game development, C++ has been a
mainstay due to its ability to handle the complex and resource-intensive requirements of modern video
games. It has also found utility in system-level programming, where direct hardware interaction and fine-
tuned memory control are paramount. Moreover, C++'s compatibility with C ensures seamless
integration with existing codebases, allowing organizations to leverage their legacy systems while
incorporating modern programming techniques. As technology continues to evolve, C++ remains a
dynamic language, continuously evolving to meet the demands of contemporary software development
while retaining its foundational strengths.

Department of ISE, SCE 2023-24 Page 4


CGPA Calculator using C++

2.1 CHARACTERISTICS OF C++:

C++ is a versatile and powerful programming language that encompasses a wide range of characteristics
that make it suitable for various applications. Some key characteristics of C++ include:
 Object-Oriented Programming (OOP): C++ is renowned for its robust support of object-
oriented programming. It allows developers to create classes and objects, promoting code
organization, reusability, and encapsulation. This paradigm facilitates modular design, making it
easier to manage and maintain complex software systems.
 Efficiency and Performance: With its roots in the C language, C++ offers high performance and
efficient memory usage. It provides low-level features like pointers and manual memory
management, giving programmers fine-grained control over system resources. This makes C++
well-suited for applications requiring speed and optimization, such as real-time systems and game
engines.
 Multiple Paradigms: C++ is not limited to object-oriented programming; it also supports
procedural and generic programming paradigms. This flexibility enables developers to choose the
most appropriate approach for a given task, allowing for a diverse range of programming styles
within a single language.
 Standard Template Library (STL): The STL is a collection of pre-built classes and functions
that provide common data structures (like vectors, queues, and maps) and algorithms (such as
sorting and searching). This library simplifies and accelerates development, as programmers can
leverage tried-and-tested components.
 Operator Overloading: C++ allows operators to be overloaded, enabling classes to define
custom behavior for standard operators such as "+", "-", "*", etc. This feature enhances code
readability and enables more intuitive use of user-defined types.
 Inheritance and Polymorphism: C++ supports class inheritance, allowing new classes to inherit
attributes and behaviors from existing classes. Polymorphism enables objects of different classes
to be treated uniformly, enhancing code extensibility and maintainability.

Department of ISE, SCE 2023-24 Page 5


CGPA Calculator using C++

 Template Metaprogramming: C++ supports template metaprogramming, a technique where


templates are used to perform computations at compile time. This can lead to more efficient code
and dynamic behaviors that are resolved during compilation.
 Portability: C++ code is highly portable across different platforms and operating systems, as
long as care is taken to avoid platform-specific features.
 Community and Ecosystem: C++ boasts a vast and active community of developers, resulting
in an extensive collection of resources, libraries, and frameworks that cater to various domains
and industries.
 Legacy Compatibility: C++ maintains backward compatibility with C, allowing seamless
integration of existing C code and enabling gradual migration to the more advanced features of
C++.

2.2 HEADER FILES:

The header files provide access to various functions and functionalities used in the program, such as
handling console input/output, managing the cursor position, generating random numbers, managing
time, and interacting with the Windows API.
 <stdio.h>: Standard Input/Output functions.
 <conio.h>: Console Input/Output functions (for functions like getch()).
 <stdlib.h>: Standard Library functions (for functions like system() and exit()).
 <string.h>: String manipulation functions (not used directly in the code, but may be used in
other parts of the program).
 <windows.h>: Windows API functions (for functions like SetConsoleCursorPosition() and
GetStdHandle()).
 <time.h>: Time functions (for functions like time()).

Department of ISE, SCE 2023-24 Page 6


CGPA Calculator using C++

2.3 CONDITION STATEMENTS:

The provided code uses several conditional statements to control the flow of the program based
on certain conditions. Here's a brief overview of the condition statements used:

 if-else Statement:

 Used in the play() function to check if the user has pressed the spacebar (ASCII value 32) to
make the bird jump. If the spacebar is pressed, the bird's position is adjusted to simulate a jump.

 Used to check if the player's bird collides with the pipes, triggering the "game over" state.

 In the main menu, used to determine the user's choice between starting the game, reading
instructions, or quitting the program.

 while Loop:
The main game loop in the play() function uses an infinite while loop. This loop repeatedly executes the
game logic, including drawing and erasing the bird, pipes, and checking for collisions, until the player
exits or the game ends.

 do-while Loop:
The main menu options are presented using a do-while loop, allowing the user to repeatedly select
options until they choose to quit.

 Nested if Statements:
Used in the play() function to determine the state of the game and decide whether to continue or end the
game based on collision and bird position.

These condition statements allow the program to respond dynamically to user input, manage gameplay,
present options to the user, and control the flow of execution based on various conditions.

Department of ISE, SCE 2023-24 Page 7


CGPA Calculator using C++

CHAPTER 3

3.1 Source Code:

#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
struct Course {
string name;
int creditHours;
double grade;
};
double CalculateCGPA (const vector<Course>& courses){
double totalGradePoints = 0.0;
int totalCreditHours = 0;
for(const Course& course: courses){
totalGradePoints += course.grade * course.creditHours;
totalCreditHours += course.creditHours;
}
if(totalCreditHours > 0){
return totalGradePoints / totalCreditHours;
} else {
return 0.0;
}
}
int main()
{
vector<Course> courses;
cout << "CGPA Calcualtor" << endl;

int numCourses;
Department of ISE, 2023-24 Page 8
SCE
CGPA Calculator using C++
cout << "Enter the number of courses: ";
cin >> numCourses;
for(int i= 0; i < numCourses; i++){
Course course;
cout << "\nEnter details for Course " << i+1 << ":" << endl;
cout << "Course Name : ";
cin.ignore();
getline(cin,course.name);
cout << "Enter the Credit : ";
cin >> course.creditHours;
cout << "Marks scored (0-10): ";
cin >> course.grade;
if(course.grade < 0 || course.grade > 10){
cout << "Invalid grade. Please enter a grade between 0 and 10." << endl;
i--;
continue;
}
courses.push_back(course);
}
double cgpa = CalculateCGPA(courses);
cout << fixed << setprecision(2);
cout << "\nYour CGPA is: " << cgpa << endl;
return 0;
}

CHAPTER 4
Department of ISE, 2023-24 Page 9
SCE
CGPA Calculator using C++
SNAPSHOTS

Fig 4.1 Course number

Fig 4.2 Course 1 details

Fig 4.3 Course 2 datails

Fig 4.4 Course 3 details

Department of ISE, 2023-24 Page 10


SCE
CGPA Calculator using C++

Fig 4.5 Course 4 details

Fig 4.6 Course 5 details

Fig 4.7 Course 6 details

Fig 4.8 Course 7 details

Fig 4.9 Course 8 details

Department of ISE, 2023-24 Page 11


SCE
CGPA Calculator using C++

Fig 5.0 Overall CGPA

Department of ISE, 2023-24 Page 12


SCE
CGPA Calculator using C++

CHAPTER 5
CONCLUSION
The project titled as CGPA calculator was deeply studied and analyzed to design the code and
implement .It was done under the guidance of the experienced project guide. All the current
requirements and possibilities have been taken care during the project time. GPA calculating
system is used for daily operations in any university to calculate their student CGPA and the
student can also easily calculate their CGPA. The Cumulative Grade Point Average (CGPA)
represents the average GPA grade a student achieves throughout their entire university or college
course. Calculating CGPA involves summing the GPA (Grade Point Average) of the student
across all semesters and then dividing it by the total credit hours. Achieving a high CGPA
necessitates obtaining good GPA scores in individual semesters.

Department of ISE, 2023-24 Page 13


SCE
CGPA Calculator using C++
CHAPTER 6

REFERENCES
 https://youtu.be/uCvnDAHfdeA?si=HRTXUml4j2J12BTP

Department of ISE, 2023-24 Page 14


SCE

You might also like