Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help grading system for college trimister with printed summary grades

waward31

Recruit
Basic Member
Messages
3
Reaction score
0
Points
16
#include<iostream>
#include<string>

using namespace std;

void Student_Info();
void CourseMark();
float CourseGrade(float);
void Display_GradeRport();
void Culculate_CGPA();
void Status(float);

struct student
{
int ID,age,year,semester;
char fname[15];
char lname[15];
char sex;
float CGPA;
struct
{
float prog1;
float Int_CS;
float prog2;
float comEng;
}course;

struct
{
float prog1g;
float Intg;
float prog2g;
float comeg;
}grade;

};
struct student s[100];

int n;
int main()
{
cout<<"====================================================\n";

cout<<" Student Grade Report system.Using C++\n";
cout<<" Programmed by: Mulu Zerabruk (The Priest)\n\n";
cout<<" 5th year computer engineering\n";
cout<<" Mekelle University\n\n";

cout<<" Welcome To Student Grade Report:\n";

cout<<"====================================================\n";

Student_Info();

CourseMark();

Culculate_CGPA();

Display_GradeRport();

}

void Student_Info()
{
int i;
cout<<"How many Student you have lessthan 100:";
cin>>n;
cout<<"\nStudent Information:\n";

for(i=0;i<n;i++)
{
cout<<"Enter student_"<<i+1<<" First name:\n";
cin>>s.fname;
cout<<"Enter student_"<<i+1<<" Last name:\n";
cin>>s.lname;
cout<<"Enter student_"<<i+1<<" ID number:\n";
cin>>s.ID;
cout<<"Enter student_"<<i+1<<" Sex:\n";
cin>>s.sex;
cout<<"Enter student_"<<i+1<<" Age:\n";
cin>>s.age;
cout<<"Enter student_"<<i+1<<" Year:\n";
cin>>s.year;
cout<<"Enter student_"<<i+1<<" Semester:\n";
cin>>s.semester;


}

}
void CourseMark()
{
int mark;

cout<<"Enter Students mark to corresponding course:\n";
for(int i=0;i<n;i++)
{
cout<<"Enter student_"<<i+1<<" programming mark:\n";
cin>>s.course.prog1;


cout<<"Enter student_"<<i+1<<" Introduction to CS:\n";
cin>>s.course.Int_CS;



cout<<"Enter student_"<<i+1<<" Programming II:\n";
cin>>s.course.prog2;


cout<<"Enter student_"<<i+1<<" Communicative English:\n";
cin>>s.course.comEng;



}


}


float CourseGrade(float mark)
{
float result;

if(mark<=100 && mark>90)
{
result=4.0;
cout<<"A+\n";
}
else if(mark<=90 && mark>85)
{
result=4;
cout<<"A\n";
}
else if(mark<=85 && mark>80)
{
result=3.75;
cout<<"A-\n";
}
else if(mark<=80 && mark>75)
{
result=3.5;
cout<<"B+\n";
}
else if(mark<=75 && mark>70)
{
result=3;
cout<<"B\n";
}
else if(mark<=70 && mark>65)
{
result=2.75;
cout<<"B-\n";
}
else if(mark<=65 && mark>60)
{
result=2.5;
cout<<"C+\n";
}
else if(mark<=60 && mark>50)
{
result=2;
cout<<"C\n";
}
else if(mark<=50 && mark>45)
{
result=1.75;
cout<<"C-\n";
}
else if(mark<=45 && mark>40)
{
result=1.5;
cout<<"D+\n";
}
else if(mark<=40 && mark>30)
{
result=1;
cout<<"D\n";
}
else if(mark<=30 && mark>0)
{
result=0;
cout<<"F\n";
}
else
{
cout<<"mark out of range.\n";
}

return result;

}


void Culculate_CGPA()
{

int credit=5;//credit hour of each course
int Tcredit=20;//total credit hour
int a;
float SumofGP[2]={0};

for(a=0;a<n;a++)
{

if((s[a].grade.prog1g !=0 && s[a].grade.Intg !=0) && (s[a].grade.comeg !=0 && s[a].grade.prog2g !=0))
{
SumofGP[a]=(s[a].grade.prog1g * credit) + (s[a].grade.Intg * credit) + (s[a].grade.comeg * credit) + (s[a].grade.prog2g*credit);
}
else if(s[a].grade.prog1g ==0)
{
SumofGP[a]= (s[a].grade.Intg * credit) + (s[a].grade.comeg * credit) + (s[a].grade.prog2g*credit);
}
else if(s[a].grade.Intg ==0)
{
SumofGP[a]=(s[a].grade.prog1g * credit) + (s[a].grade.comeg * credit) + (s[a].grade.prog2g*credit);
}
else if(s[a].grade.prog2g ==0)
{
SumofGP[a]=(s[a].grade.prog1g * credit) + (s[a].grade.Intg * credit) + (s[a].grade.comeg * credit);
}
else
{
SumofGP[a]=(s[a].grade.prog1g * credit) + (s[a].grade.Intg * credit) + (s[a].grade.prog2g*credit);
}



s[a].CGPA=SumofGP[a]/Tcredit;
}

}


void Display_GradeRport()
{
int i,j;
float alpha;
cout<<"Student Grade Report:\n";
cout<<"============================================================================\n";
for(i=0;i<n;i++)
{
cout<<"Full Name: "<<s.fname<<"\t"<<s.lname<<"\t"<<"Year:"<<s.year<<"\tSemester: "<<s.semester<<endl;
cout<<"Sex: "<<s.sex<<"\t"<<"Age: "<<s.age<<endl<<endl;

for(j=0;j<4;j++)
{
if(j==0)
{
alpha=s.grade.prog1g;
cout<<"Programming I: \t";
s.grade.prog1g=CourseGrade(s.course.prog1);
}
else if(j==1)
{
alpha=s.grade.Intg;
cout<<"Introduction to CS: \t";
s.grade.Intg=CourseGrade(s.course.Int_CS);

}
else if(j==2)
{
alpha=s.grade.prog2g;
cout<<"Programming II: \t";
s.grade.prog2g=CourseGrade(s.course.prog2);
}
else
{
alpha=s.grade.comeg;
cout<<"Communicative English:\t";
s.grade.comeg=CourseGrade(s.course.comEng);
}

}

Culculate_CGPA();

cout<<"CGPA="<<s.CGPA<<endl;;

Status(s.CGPA);

cout<<"============================================================================\n";

}



}



void Status(float sta)
{
if(sta==4)
{
cout<<"Status: Very great distinction.\n";
}
else if(sta>=3.75 && sta<=3.99)
{
cout<<"Status: Grate distinction.\n";
}
else if(sta>3.5 && sta<=3.74)
{
cout<<"Status: Distinction.\n";
}
else if(sta>3.49 && sta<=3.25)
{
cout<<"Status: dean's list.\n";
}
else if(sta>=2.0 && sta<=3.24)
{
cout<<"Status: Promoted.\n";
}
else if(sta>1.75 && sta<=1.99)
{
cout<<"Status: Warning.\n";
}
else if(sta>1.00 && sta<=1.74)
{
cout<<"Status: Readmission.\n";
}
else if(sta>0.0 && sta<1.0)
{
cout<<"Status: Distinction.\n";
}

}


gnyan po sana yung language nya kaso need ko po ng prelim midterm tas final yung computation nya for PRELIM EXAM RATE = SCORE/ NO. of Item *50+50

yung pag compute naman ng PG = 2CS+PRELIM EXAM RATE/3

SA MIDTERM GRADE NAMAN SAME LNG PERO CA = 2CS+MIDTERM EXAM RATE/3

Nalilito po kasi ako sa STRUCT tapos nilalagay dn yung variables
 
Back
Top Bottom