In this article I would like to share with you guys the work of my good friend and fellow software engineer Sir Christian Catilogo he wrote this student records system in C++ programming language to manage the grades and student records.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.
Program Listing
students.cpp
#include <iostream>
#include<iomanip>
#include<windows.h>
using namespace std;
struct student
{
char Lname[25], Fname[25],Mname[25],course[25];
int studno,recordno,yearlevel,mquiz[2],mass[2], mattendance,mexam,mproject,mrecitation,
fquiz[2],fass[2],fattendance,fexam,fproject,frecitation;
float mquizgrade=0.0, mquiztotal=0.0, mquizave,mprojectave,mrecitationave,
massgrade=0.0, masstotal=0.0, massave,mattave,mexamave,midtotal=0.0,midave,
fquizgrade=0.0, fquiztotal=0.0, fquizave, fprojectave,frecitationave,
fassgrade=0.0, fasstotal=0.0, fassave,fattave,fexamave,finaltotal=0.0,finalave,
finalgrade;
};
int compare (const void* p, const void* q)
{
return (((struct student*)p)->finalgrade < ((struct student*)q)->finalgrade);
}
int main()
{
HANDLE color=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color,15);
char let;
int arr=0,studentno=0;
struct student stud[50];
struct student *ptr;
ptr=stud;
do{
qsort(stud, arr, sizeof(struct student), compare);
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t\t STUDENT RECORD \n";
cout<<"\t\t\t\t\t ~~MENU~~\n";
SetConsoleTextAttribute(color,11);
cout<<"\n\t\t\t\t Press 1 Create Student Record \n";
cout<<"\n\t\t\t\t Press 2 Delete Student Record \n";
cout<<"\n\t\t\t\t Press 3 Update Student Record \n";
cout<<"\n\t\t\t\t Press 4 Search Student Record \n";
cout<<"\n\t\t\t\t Press 5 Display All Record \n";
cout<<"\n\t\t\t\t Press 6 Display Student Ranking \n";
cout<<"\n\t\t\t\t Press 7 Display Failed Student Record \n";
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t (Input must be integer)\n";
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t\t\t\t Select Option: ";
int stchek=0;
int sw;
SetConsoleTextAttribute(color,15);
cin>>sw;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again ";
cin.clear();
cin.ignore();
goto repeat;
}
switch (sw)
{
case 1:
aaa:
SetConsoleTextAttribute(color,13);
cout<<"\n\t\t\t Enter the Data of the student to create record "<<endl;
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Record number = ";
int st2;
int st;
SetConsoleTextAttribute(color,15);
cin>>st;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto aaa;
}
for(int j=0;j<=arr;j++)
{
st2=st;
if(st2==stud[j].recordno)
{
stchek=1;
}
}
if(stchek!=1){
ptr->recordno=st;
int i=0;
cout<<"\n \t\t The Student no = ";
SetConsoleTextAttribute(color,15);
cout<<"19-0"<<++studentno<<endl;
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter the Last Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Lname;
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter the First Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Fname;
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter the Middle Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Mname;
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter the Course = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->course;
yl:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter the Year Level = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->yearlevel;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto yl;
}
else if(ptr->yearlevel>5)
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t The maximum Yearlevel is [5] ";
cout<<"\n\t\t Please try it Again \n";
goto yl;
}
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t\t\t\t [Enter Midterm Grade] ";
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Quiz Average Grade = (20%)";
for (int quiz=0; quiz<2; quiz++)
{
a:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Quiz grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mquiz[quiz];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto a;
}
else if(ptr->mquiz[quiz]<50 || ptr->mquiz[quiz]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto a;
}
}
for (int quiz=0; quiz<2; quiz++)
{
ptr->mquizgrade+=ptr->mquiz[quiz];
}
ptr->mquiztotal=ptr->mquizgrade/2;
ptr->mquizave=ptr->mquiztotal*.2;
i=0;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Assignment Average Grade = (10%)";
for (int ass=0; ass<2; ass++)
{
b:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Assignment Grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mass[ass];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto b;
}
else if (ptr->mass[ass]<50 || ptr->mass[ass]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto b;
}
}
for (int ass=0; ass<2; ass++)
{
ptr->massgrade+=ptr->mass[ass];
}
ptr->masstotal=ptr->massgrade/2;
ptr->massave=ptr->masstotal*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Attendance Average Grade = (10%)";
c:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Attendance Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mattendance;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto c;
}
else if(ptr->mattendance<50 || ptr->mattendance>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto c;
}
ptr->mattave=ptr->mattendance*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Midterm Exam Average Grade = (30%)";
d:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Midterm Exam Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mexam;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto d;
}
else if (ptr->mexam<50 || ptr->mexam>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto d;
}
ptr->mexamave=ptr->mexam*.3;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Project Average Grade = (20%) ";
e:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Project Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mproject;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto e;
}
else if (ptr->mproject<50 || ptr->mproject>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto e;
}
ptr->mprojectave=ptr->mproject*.2;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Recitation Average Grade = (10%) ";
f:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Recitation Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mrecitation;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto f;
}
else if (ptr->mrecitation<50 || ptr->mrecitation>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto f;
}
ptr->mrecitationave=ptr->mrecitation*.1;
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t\t\t\t[Enter Finalterm Grade] ";
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Quiz Average Grade = (20%)";
i=0;
for (int quiz=0; quiz<2; quiz++)
{
aa:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Quiz grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fquiz[quiz];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto aa;
}
else if(ptr->fquiz[quiz]<50 || ptr->fquiz[quiz]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto aa;
}
}
for (int quiz=0; quiz<2; quiz++)
{
ptr->fquizgrade+=ptr->fquiz[quiz];
}
ptr->fquiztotal=ptr->fquizgrade/2;
ptr->fquizave=ptr->fquiztotal*.2;
i=0;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Assignment Average Grade = (10%)";
for (int ass=0; ass<2; ass++)
{
bb:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Assignment Grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fass[ass];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto bb;
}
else if (ptr->fass[ass]<50 || ptr->fass[ass]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto bb;
}
}
for (int ass=0; ass<2; ass++)
{
ptr->fassgrade+=ptr->fass[ass];
}
ptr->fasstotal=ptr->fassgrade/2;
ptr->fassave=ptr->fasstotal*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Attendance Average Grade = (10%)";
cc:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Attendance Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fattendance;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto cc;
}
else if(ptr->fattendance<50 || ptr->fattendance>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto cc;
}
ptr->fattave=ptr->fattendance*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Midterm Exam Average Grade = (30%)";
dd:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Midterm Exam Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fexam;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto dd;
}
else if (ptr->fexam<50 || ptr->fexam>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto dd;
}
ptr->fexamave=ptr->fexam*.3;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Project Average Grade = (20%) ";
ee:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Project Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fproject;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ee;
}
else if (ptr->fproject<50 || ptr->fproject>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto ee;
}
stud[arr].fprojectave=stud[arr].fproject*.2;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Recitation Average Grade = (10%) ";
ff:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Recitation Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->frecitation;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ff;
}
else if (ptr->frecitation<50 || ptr->frecitation>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto ff;
}
ptr->frecitationave=ptr->frecitation*.1;
ptr->midtotal=ptr->midtotal+ptr->mquizave+ptr->massave+ptr->mattave+
ptr->mexamave+ptr->mprojectave+ptr->mrecitationave;
ptr->finaltotal=ptr->finaltotal+ptr->fquizave+ptr->fassave+ptr->fattave+
ptr->fexamave+ptr->fprojectave+ptr->frecitationave;
ptr->midave=ptr->midtotal*.50;
ptr->finalave=ptr->finaltotal*.50;
ptr->finalgrade=ptr->midave+ptr->finalave;
ptr->studno=studentno;
arr++;
ptr++;
}
else
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t\t This Record Number already have record \n";
}
break;
case 2:
bbb:
SetConsoleTextAttribute(color,13);
cout<<"\n\t\t Enter the Record number of the student record To Delete : ";
SetConsoleTextAttribute(color,15);
cin>>st;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto bbb;
}
for(int j=0;j<=arr;j++)
{
st2=st;
if(st2==stud[j].recordno)
{
stud[j].recordno='d';
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t [Record Deleted]";
SetConsoleTextAttribute(color,15);
}
}
break;
case 3:
ptr=stud;
cout<<fixed<<showpoint;
cout<<setprecision(2);
ccc:
SetConsoleTextAttribute(color,13);
cout<<"\n\t\t\t Enter the Record no of the student To Update : ";
SetConsoleTextAttribute(color,15);
cin>>st;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ccc;
}
for(int j=0;j<=arr;j++)
{
st2=st;
if(st2==ptr->recordno)
{
int i=0;
cout<<"\n\t\t Recordno = ";
cout<<ptr->recordno;
cout<<"\n\t\t Student no = 19-0"<<ptr->studno;
cout<<"\n \t\t Last Name = ";
cout<<ptr->Lname;
cout<<"\n \t\t First Name = ";
cout<<ptr->Fname;
cout<<"\n \t\t Middle Name = ";
cout<<ptr->Mname;
cout<<"\n \t\t Course = ";
cout<<ptr->course;
cout<<"\n \t\t Year Level = ";
cout<<ptr->yearlevel;
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Midterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->mquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->massave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->mattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->mexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->mprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->mrecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Finalterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->fquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->fassave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->fattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->fexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->fprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->frecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t\t\t Final Average = "<<ptr->finalgrade<<"%";
SetConsoleTextAttribute(color,14);
if (ptr->finalgrade>=98 && ptr->finalgrade<=100)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.00";
}
else if (ptr->finalgrade>=95 && ptr->finalgrade<=97)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.25";
}
else if (ptr->finalgrade>=92 && ptr->finalgrade<=94)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.50";
}
else if (ptr->finalgrade>=89 && ptr->finalgrade<=91)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.75";
}
else if (ptr->finalgrade>=86 && ptr->finalgrade<=88)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.00";
}
else if (ptr->finalgrade>=83 && ptr->finalgrade<=85)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.25";
}
else if (ptr->finalgrade>=80 && ptr->finalgrade<=82)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.25";
}
else if (ptr->finalgrade>=78 && ptr->finalgrade<=79)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.50";
}
else if (ptr->finalgrade>=76 && ptr->finalgrade<=77)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.75";
}
else if (ptr->finalgrade>=75)
{
cout<<"\n\t\t\t\t\t PASSED "<<"3.00";
}
else
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t FAILED "<<"5.00";
}
ptr->mquiztotal=0.0,ptr->mquizgrade=0.0, ptr->masstotal=0.0, ptr->massgrade=0.0;
ptr->fquiztotal=0.0,ptr->fquizgrade=0.0, ptr->fasstotal=0.0, ptr->fassgrade=0.0;
ptr->midtotal=0.0, ptr->finaltotal=0.0, ptr->finalgrade=0.0;
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t ReEnter Data ";
SetConsoleTextAttribute(color,11);
cout<<"\n\t\t Enter the Last Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Lname;
SetConsoleTextAttribute(color,11);
cout<<"\n\t\t Enter the First Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Fname;
SetConsoleTextAttribute(color,11);
cout<<"\n\t\t Enter the Middle Name = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->Mname;
SetConsoleTextAttribute(color,11);
cout<<"\n\t\t Enter the Course = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->course;
SetConsoleTextAttribute(color,11);
yls:
cout<<"\n\t\t Enter the Year Level = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->yearlevel;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto yls;
}
else if(ptr->yearlevel>5)
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t The maximum Yearlevel is [5] ";
cout<<"\n\t\t Please try it Again \n";
goto yls;
}
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t [Enter Midterm Grade] ";
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Quiz Average Grade = (20%)";
for (int quiz=0; quiz<2; quiz++)
{
g:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Quiz grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mquiz[quiz];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto g;
}
else if(ptr->mquiz[quiz]<50 || ptr->mquiz[quiz]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto g;
}
}
for (int quiz=0; quiz<2; quiz++)
{
ptr->mquizgrade+=ptr->mquiz[quiz];
}
ptr->mquiztotal=ptr->mquizgrade/2;
ptr->mquizave=ptr->mquiztotal*.2;
i=0;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Assignment Average Grade = (10%)";
for (int ass=0; ass<2; ass++)
{
h:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Assignment Grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mass[ass];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto h;
}
else if (ptr->mass[ass]<50 || ptr->mass[ass]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto h;
}
}
for (int ass=0; ass<2; ass++)
{
ptr->massgrade+=ptr->mass[ass];
}
ptr->masstotal=ptr->massgrade/2;
ptr->massave=ptr->masstotal*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Attendance Average Grade = (10%)";
i:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Attendance Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mattendance;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto i;
}
else if(ptr->mattendance<50 || ptr->mattendance>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto i;
}
ptr->mattave=ptr->mattendance*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Midterm Exam Average Grade = (30%)";
j:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Midterm Exam Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mexam;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto j;
}
else if (ptr->mexam<50 || ptr->mexam>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto j;
}
ptr->mexamave=ptr->mexam*.3;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Project Average Grade = (20%) ";
k:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Project Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mproject;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto k;
}
else if (ptr->mproject<50 || ptr->mproject>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto k;
}
ptr->mprojectave=ptr->mproject*.2;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Recitation Average Grade = (10%) ";
l:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Recitation Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->mrecitation;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto l;
}
else if (ptr->mrecitation<50 || ptr->mrecitation>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto l;
}
ptr->mrecitationave=ptr->mrecitation*.1;
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t\t\t\t [Enter Finalterm Grade] ";
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Quiz Average Grade = (20%)";
i=0;
for (int quiz=0; quiz<2; quiz++)
{
gg:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Quiz grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fquiz[quiz];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto gg;
}
else if(ptr->fquiz[quiz]<50 || ptr->fquiz[quiz]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto gg;
}
}
for (int quiz=0; quiz<2; quiz++)
{
ptr->fquizgrade+=ptr->fquiz[quiz];
}
ptr->fquiztotal=ptr->fquizgrade/2;
ptr->fquizave=ptr->fquiztotal*.2;
i=0;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Assignment Average Grade = (10%)";
for (int ass=0; ass<2; ass++)
{
hh:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Assignment Grade no "<<++i<<" = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fass[ass];
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
i=i-1;
goto hh;
}
else if (ptr->fass[ass]<50 || ptr->fass[ass]>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
i=i-1;
goto hh;
}
}
for (int ass=0; ass<2; ass++)
{
ptr->fassgrade+=ptr->fass[ass];
}
ptr->fasstotal=ptr->fassgrade/2;
ptr->fassave=ptr->fasstotal*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Attendance Average Grade = (10%)";
ii:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Attendance Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fattendance;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ii;
}
else if(ptr->fattendance<50 || ptr->fattendance>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto ii;
}
ptr->fattave=ptr->fattendance*.1;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Midterm Exam Average Grade = (30%)";
jj:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Midterm Exam Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fexam;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto jj;
}
else if (ptr->fexam<50 || ptr->fexam>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto jj;
}
ptr->fexamave=ptr->fexam*.3;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Project Average Grade = (20%) ";
kk:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Project Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->fproject;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto kk;
}
else if (ptr->fproject<50 || ptr->fproject>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto kk;
}
ptr->fprojectave=ptr->fproject*.2;
SetConsoleTextAttribute(color,14);
cout<<"\n \t\t Recitation Average Grade = (10%) ";
ll:
SetConsoleTextAttribute(color,11);
cout<<"\n \t\t Enter Recitation Grade = ";
SetConsoleTextAttribute(color,15);
cin>>ptr->frecitation;
SetConsoleTextAttribute(color,11);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ll;
}
else if (ptr->frecitation<50 || ptr->frecitation>100)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!!";
cout<<"\n \t\t Input Shouldn't be Lessthan 50 or Greaterthan 100 ";
cout<<"\n \t\t Please Try it Again \n";
goto ll;
}
ptr->frecitationave=ptr->frecitation*.1;
ptr->midtotal=ptr->midtotal+ptr->mquizave+ptr->massave+ptr->mattave+
ptr->mexamave+ptr->mprojectave+ptr->mrecitationave;
ptr->finaltotal=ptr->finaltotal+ptr->fquizave+ptr->fassave+ptr->fattave+
ptr->fexamave+ptr->fprojectave+ptr->frecitationave;
ptr->midave=ptr->midtotal*.50;
ptr->finalave=ptr->finaltotal*.50;
ptr->finalgrade=ptr->midave+ptr->finalave;
}
ptr++;
}
break;
case 4:
ptr=stud;
ddd:
SetConsoleTextAttribute(color,13);
cout<<"\n \t\t\t Enter the Record number To Search : ";
SetConsoleTextAttribute(color,15);
cin>>st;
SetConsoleTextAttribute(color,15);
if(!cin)
{
SetConsoleTextAttribute(color,12);
cout<<"\n \t\t Invalid Input !!! ";
cout<<"\n \t\t Please Try it Again \n";
cin.clear();
cin.ignore();
goto ddd;
}
for(int j=0;j<=arr;j++)
{
st2=st;
if(st2==ptr->recordno)
{
cout<<fixed<<showpoint;
cout<<setprecision(2);
SetConsoleTextAttribute(color,15);
cout<<"\n\t\tRecordno = ";
cout<<ptr->recordno;
cout<<"\n\t\tStudent no = 19-0"<<ptr->studno;
cout<<"\n\t\tLast Name = ";
cout<<ptr->Lname;
cout<<"\n\t\tFirst Name = ";
cout<<ptr->Fname;
cout<<"\n\t\tMiddle Name = ";
cout<<ptr->Mname;
cout<<"\n\t\tCourse = ";
cout<<ptr->course;
cout<<"\n\t\tYear Level = ";
cout<<ptr->yearlevel;
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Midterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->mquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->massave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->mattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->mexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->mprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->mrecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Finalterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->fquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->fassave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->fattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->fexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->fprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->frecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t\t\t Final Average = "<<ptr->finalgrade<<"%";
SetConsoleTextAttribute(color,14);
if (ptr->finalgrade>=98 && ptr->finalgrade<=100)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.00";
}
else if (ptr->finalgrade>=95 && ptr->finalgrade<98)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.25";
}
else if (ptr->finalgrade>=92 && ptr->finalgrade<95)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.50";
}
else if (ptr->finalgrade>=88 && ptr->finalgrade<92)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.75";
}
else if (ptr->finalgrade>=85 && ptr->finalgrade<88)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.00";
}
else if (ptr->finalgrade>=81 && ptr->finalgrade<85)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.25";
}
else if (ptr->finalgrade>=78 && ptr->finalgrade<81)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.50";
}
else if (ptr->finalgrade>=76 && ptr->finalgrade<78)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.75";
}
else if (ptr->finalgrade>=75 && ptr->finalgrade<76)
{
cout<<"\n\t\t\t\t\t PASSED "<<"3.00";
}
else
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t FAILED "<<"5.00";
}
SetConsoleTextAttribute(color,15);
}
ptr++;
}
break;
case 5:
ptr=stud;
for(int k=0;k<arr;k++)
{
if (ptr->recordno!='d')
{
cout<<fixed<<showpoint;
cout<<setprecision(2);
SetConsoleTextAttribute(color,15);
cout<<"\n\t\tRecordno: "<<ptr->recordno;
cout<<"\n\t\tStudent no = 19-0"<<ptr->studno;
cout<<"\n\t\tLast Name: "<<ptr->Lname;
cout<<"\n\t\tFirst Name: "<<ptr->Fname;
cout<<"\n\t\tMiddle Name: "<<ptr->Mname;
cout<<"\n\t\tCourse: "<<ptr->course;
cout<<"\n\t\tYear Level: "<<ptr->yearlevel;
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Midterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->mquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->massave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->mattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->mexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->mprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->mrecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
SetConsoleTextAttribute(color,14);
cout<<"\n\t\t\t\t [Finalterm Grade Record]";
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t|\t Catergory"<<"\t |\t Average \t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t| Quiz Average\t |\t "<<ptr->fquizave<<"%\t |";
cout<<"\n\t\t\t| Assignment Average\t |\t "<<ptr->fassave<<"%\t |";
cout<<"\n\t\t\t| Attendance Average\t |\t "<<ptr->fattave<<"%\t |";
cout<<"\n\t\t\t| Midterm Exam Average |\t "<<ptr->fexamave<<"%\t |";
cout<<"\n\t\t\t| Project Average\t |\t "<<ptr->fprojectave<<"%\t |";
cout<<"\n\t\t\t| Recitation Average\t |\t "<<ptr->frecitationave<<"%\t |";
cout<<"\n\t\t\t+------------------------+------------------------+";
cout<<"\n\t\t\t\t\t Final Average = "<<ptr->finalgrade<<"%";
SetConsoleTextAttribute(color,14);
if (ptr->finalgrade>=98 && ptr->finalgrade<=100)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.00";
}
else if (ptr->finalgrade>=95 && ptr->finalgrade<98)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.25";
}
else if (ptr->finalgrade>=92 && ptr->finalgrade<95)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.50";
}
else if (ptr->finalgrade>=88 && ptr->finalgrade<92)
{
cout<<"\n\t\t\t\t\t PASSED "<<"1.75";
}
else if (ptr->finalgrade>=85 && ptr->finalgrade<88)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.00";
}
else if (ptr->finalgrade>=81 && ptr->finalgrade<85)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.25";
}
else if (ptr->finalgrade>=78 && ptr->finalgrade<81)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.50";
}
else if (ptr->finalgrade>=76 && ptr->finalgrade<78)
{
cout<<"\n\t\t\t\t\t PASSED "<<"2.75";
}
else if (ptr->finalgrade>=75 && ptr->finalgrade<76)
{
cout<<"\n\t\t\t\t\t PASSED "<<"3.00";
}
else
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t\t FAILED "<<"5.00";
}
SetConsoleTextAttribute(color,15);
cout<<"\n\t_________________________________________________________________________________\n";
}
ptr++;
}
break;
case 6:
ptr=stud;
int rank;
cout<<fixed<<showpoint;
cout<<setprecision(2);
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t\t *+*+*+*+*+*+*+*+*+*+*+*+*+*+\n";
cout<<"\t\t\t\t *+";
SetConsoleTextAttribute(color,14);
cout<<" STUDENT RECORD RANKING ";
SetConsoleTextAttribute(color,15);
cout<<"*+\n";
cout<<"\t\t\t\t *+*+*+*+*+*+*+*+*+*+*+*+*+*+\n";
SetConsoleTextAttribute(color,13);
cout<<"\t +------+-----------+------------------------------------+---------------+----------+\n";
SetConsoleTextAttribute(color,15);
cout<<setw(15)<<"Rank";
cout<<setw(12)<<"StudentNo";
cout<<setw(22)<<"Name";
cout<<setw(31)<<"Course & Year";
cout<<setw(9)<<"Grade"<<endl;
SetConsoleTextAttribute(color,13);
cout<<"\t +------+-----------+------------------------------------+---------------+----------+\n";
SetConsoleTextAttribute(color,15);
for (int k=0; k<arr; k++)
{
rank=k+1;
if(ptr->finalgrade>=75)
{
if(rank<4)
{
SetConsoleTextAttribute(color,14);
cout<<right<<setw(13)<<rank;
cout<<right<<setw(11)<<"19-0"<<ptr->studno;
cout<<right<<setw(18)<<ptr->Fname;
cout<<right<<setw(10)<<ptr->Mname;
cout<<right<<setw(10)<<ptr->Lname;
cout<<right<<setw(14)<<ptr->course<<"-"<<ptr->yearlevel;
cout<<right<<setw(10)<<ptr->finalgrade<<"%"<<endl;
}
else if (rank>=4 && rank<=10)
{
SetConsoleTextAttribute(color,15);
cout<<right<<setw(13)<<rank;
cout<<right<<setw(11)<<"19-0"<<ptr->studno;
cout<<right<<setw(18)<<ptr->Fname;
cout<<right<<setw(10)<<ptr->Mname;
cout<<right<<setw(10)<<ptr->Lname;
cout<<right<<setw(14)<<ptr->course<<"-"<<ptr->yearlevel;
cout<<right<<setw(10)<<ptr->finalgrade<<"%"<<endl;
}
ptr++;
}
}
SetConsoleTextAttribute(color,13);
cout<<"\t +------+-----------+------------------------------------+---------------+----------+\n";
SetConsoleTextAttribute(color,15);
break;
case 7:
ptr=stud;
cout<<fixed<<showpoint;
cout<<setprecision(2);
SetConsoleTextAttribute(color,15);
cout<<"\n\t\t\t\t *+*+*+*+*+*+*+*+*+*+*+*+*\n";
cout<<"\t\t\t\t *+";
SetConsoleTextAttribute(color,12);
cout<<" FAILED STUDENT LIST ";
SetConsoleTextAttribute(color,15);
cout<<"+*\n";
cout<<"\t\t\t\t *+*+*+*+*+*+*+*+*+*+*+*+*\n";
SetConsoleTextAttribute(color,13);
cout<<"\t +---------+----------+----------------------------------+---------------+----------+\n";
SetConsoleTextAttribute(color,15);
cout<<setw(18)<<"RecordNo";
cout<<setw(11)<<"StudentNo";
cout<<setw(21)<<"Name";
cout<<setw(30)<<"Course & Year";
cout<<setw(9)<<"Grade"<<endl;
SetConsoleTextAttribute(color,13);
cout<<"\t +---------+----------+----------------------------------+---------------+----------+\n";
for (int j=0; j<arr; j++)
{
if(ptr->finalgrade<75)
{
SetConsoleTextAttribute(color,15);
cout<<right<<setw(15)<<ptr->recordno;
cout<<right<<setw(11)<<"19-0"<<ptr->studno;
cout<<right<<setw(16)<<ptr->Fname;
cout<<right<<setw(10)<<ptr->Mname;
cout<<right<<setw(10)<<ptr->Lname;
cout<<right<<setw(14)<<ptr->course<<"-"<<ptr->yearlevel;
cout<<right<<setw(10)<<ptr->finalgrade<<"%"<<endl;
}
ptr++;
}
SetConsoleTextAttribute(color,13);
cout<<"\t +---------+----------+----------------------------------+---------------+----------+\n";
SetConsoleTextAttribute(color,15);
break;
default:
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t Wrong option Selected ";
}
repeat:
SetConsoleTextAttribute(color,15);
cout<<"\n \n \t\t Do You want to Continue Again [Y/N] = ";
cin>>let;
}
while(let=='y' || let=='Y');
if(let=='n' || let=='N')
{
SetConsoleTextAttribute(color,12);
cout<<"\n\t\t\t\t [End of the Program]";
SetConsoleTextAttribute(color,15);
}
return 0;
}
No comments:
Post a Comment