GPA calculator in c++ language | Basic C++ Programming Language

GPA calculator in c++ language | Basic C++ Programming Language.


GPA Calculator:

This is the GPA calculator in C++ Programming Language. It is a very basic calculator in C++. With the help of this Project, you can do multiple tasks.

Task You Can be Done Using C++ Project:


The Following task can be done using the GPA Calculator in c++:
  • Data enrolled.
  • Get the student with a high GPA.
  • Sort the Students according to their GPA.
  • Get The Details Of Student.
  • Get The Student With High Absentees.

GPA calculator in c++ language  Basic C++ Programming Language
GPA calculator in c++ language  Basic C++ Programming Language

Now the Code Of this project Here:

/*
#include<iostream>
using namespace std;
int main()
{
char  a = 'y', name[10] = { '\0' };
float cgpa[10];
int abs[10], i = 0, uid[10], opt, k = 0;
while (a == 'y' || a == 'Y' && i < 10)
{
cout << "*********************************" << endl;
cout << "Enter student initial(first characte of name)    :";
cin >> name[i];
cout << "Enter student ID   :";
cin >> uid[i];
cout << "Enter student cgpa   :";
cin >> cgpa[i];
cout << "Enter student absent  :";
cin >> abs[i];
i++;
cout << " Enter condition   :";
cin >> a;
k++;
cout << "*********************************" << endl;
}
cout << "****************************************************************************************" << endl;
cout << "1. Enter data for all the enrolled student" << endl;
cout << "2. Enter the data of the student with highest and lowest CGPA" << endl;
cout << "3. Enter the sorted record of a student on the basis of their CGPA in ascending order" << endl;
cout << "4. Enter the details of the students whose absents are more than 20." << endl;
cout << "****************************************************************************************" << endl;

cout << "Enter Option" << endl;
cin >> opt;
if (opt == 1)
{
for (int b = 0; b < i; b++)
{
cout << "***********************************************" << endl;
cout << " The name of student is \n\n " << name[b] << endl;
cout << " The student unique id is\n\n" << uid[b] << endl;
cout << "The student cgpa is\n\n" << cgpa[b] << endl;
cout << "The student absent is\n\n" << abs[b] << endl;
cout << "*************************************************" << endl;

}
}

if (opt == 2)
{
bool test = true;
for (int c = 0; c < k; c++)
{
for (int d = 0; d < k; d++)
{
if (cgpa[c] >cgpa[d])
{
test = true;
}
else if (cgpa[c] < cgpa[d] && c != d)
{
test = false;
break;
}
}
if (test == true)
{
cout << "********************************************" << endl;
cout << "The maximum cgpa of the student" << endl;
cout << "The name of student is\n\n" << name[c] << endl;
cout << "The student unique id is\n\n" << uid[c] << endl;
cout << "The student cgpa is\n\n" << cgpa[c] << endl;
cout << "The student absent is\n\n" << abs[c] << endl;
break;
cout << "**********************************************" << endl;

}
}

for (int e = 0; e < k; e++)
{
for (int f = 0; f < k; f++)
{
if (cgpa[e] < cgpa[f])
{
test = true;
}
else if (cgpa[e] > cgpa[f] && e != f)
{
test = false;
break;
}
}
if (test == true)
{
cout << "***********************************************" << endl;
cout << "The minimum cgpa of the student" << endl;
cout << "The student id is\n\n" << name[e] << endl;
cout << "The student unique id is\n\n" << uid[e] << endl;
cout << "The student cgpa is\n\n" << cgpa[e] << endl;
cout << "The student absent is\n\n" << abs[e] << endl;
break;
cout << "**********************************************" << endl;
}
}
}


if (opt == 3)
{
cout << endl;
cout << "***************************" << endl;
cout << "entering option 3" << endl;
cout << "***************************" << endl;
for (int g = 0; g < k; g++)
{
for (int h = g + 1; h < k; h++)
{
if (cgpa[g] < cgpa[h])
{
swap(cgpa[g], cgpa[h]);
swap(name[g], name[h]);
swap(uid[g], uid[h]);
swap(abs[g], abs[h]);
}
}
cout << endl;
}
for (int i = 0; i < k; i++)
{
cout << "**************************************" << endl;
cout << "The student name is\n\n" << name[i] << endl;
cout << "The student unique id is\n\n" << uid[i] << endl;
cout << "The student cgpa is\n\n" << cgpa[i] << endl;
cout << "The student absent is\n\n" << abs[i] << endl;
cout << "****************************************" << endl;
}
}
system("PAUSE");
return 0;
}
*/

Conclusion:

So we can conclude that with the help of this project you can do an easy task. this will help you really to learn programming language specially c++ Programming.



If you have any suggestions related to this piece of code then please let me know in the comment section.

with the best regard,
Bilal Ahmad.

No comments

Please tell me if you have any suggestions related to these projects.
thanks

Powered by Blogger.