0% found this document useful (0 votes)
22 views

GPA Calculator

Uploaded by

Kaiwalya Matre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

GPA Calculator

Uploaded by

Kaiwalya Matre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

KCE COLLEGE OF

ENGINEERING
G PA C A L C U L AT O R
PROGRAM OF GPA CALCULATOR
#include <iostream>
#include <iomanip>

using namespace std;

int main() {
int numCourses;
cout << "Enter the number of courses: ";
cin >> numCourses;

double totalCredits = 0;
double totalGradePoints = 0;

for (int i = 1; i <= numCourses; i++) {


double credits;
cout << "Enter credits for course " << i <<
": ";
char grade;
cout << "Enter grade (A, B, C, D, or F)
for course " << i << ": ";
cin >> grade;

double gradePoints;
switch (grade) {
case 'A':
gradePoints = 4.0;
break;
case 'B':
gradePoints = 3.0;
break;
case 'C':
gradePoints = 2.0;
break;
case 'D':
gradePoints = 1.0;
break;
case 'F':
gradePoints = 0.0;
break;
default:
cout << "Invalid grade entered.
Please enter A, B, C, D, or F." << endl;
i--;
continue;
}

totalCredits += credits;
totalGradePoints += credits * gradePoints;
}

double gpa = totalGradePoints / totalCredits;

cout << fixed << setprecision(2);


cout << "Your GPA is: " << gpa << endl;

return 0;
}
OUTPUT
PROCEDURE

• 1] dev c++
• 2] pogram of GPA calculator
• 3] power point
• 4] output screen
• 5] Microsoft word
• 132 chandrakant
mahajan
• 131 niketan badgujar
THANK YOU • 130 Namrata kawalkar
MADE BY

You might also like