void display_sp(int n)
{
node rec;
student st;
ifstream inFile;
inFile.open("student.txt",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
cur=start;
while(inFile.read((char *) &rec, sizeof(rec)))
{
if( cur->roll_no==n)
{
cout<<"\nRoll number of student : "<<cur->roll_no;
cout<<"\nStudentname of student : "<<cur->name;
cout<<"\nMarks in Physics : "<<cur->p_m;
cout<<"\nMarks in Chemistry : "<<cur->c_m;
cout<<"\nMarks in Maths : "<<cur->m_m;
cout<<"\nMarks in English : "<<cur->e_m;
cout<<"\nMarks in Computer Science :"<<cur->cs_m;
cout<<"\nPercentage of student is :"<<cur->per;
cout<<"\nGrade of student is :"<<cur->grade;
flag=1;
}
cur=cur->nxt;
}
inFile.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}
cout<<"\nRoll number of student : "<<cur->roll_no;
cout<<"\nStudentname of student : "<<cur->name;
cout<<"\nMarks in Physics : "<<cur->p_m;
cout<<"\nMarks in Chemistry : "<<cur->c_m;
cout<<"\nMarks in Maths : "<<cur->m_m;
cout<<"\nMarks in English : "<<cur->e_m;
cout<<"\nMarks in Computer Science :"<<cur->cs_m;
cout<<"\nPercentage of student is :"<<cur->per;
cout<<"\nGrade of student is :"<<cur->grade;
cur=cur->nxt;
}
}
cout<<"\nroll number of student ";
cin>>start->roll_no;
cout<<"\n\nStudentname of student ";
cin>>start->name;
cout<<"\nmarks in physics out of 100 : ";
cin>>start->p_m;
cout<<"\nmarks in chemistry out of 100 : ";
cin>>start->c_m;
cout<<"\nmarks in maths out of 100 : ";
cin>>start->m_m;
cout<<"\nmarks in english out of 100 : ";
cin>>start->e_m;
cout<<"\nmarks in computer science out of 100 : ";
cin>>start->cs_m;
cout<<"\nroll number of student ";
cin>>start->roll_no;
cout<<"\n\nStudentname of student ";
cin>>start->name;
cout<<"\nmarks in physics out of 100 : ";
cin>>start->p_m;
cout<<"\nmarks in chemistry out of 100 : ";
cin>>start->c_m;
cout<<"\nmarks in maths out of 100 : ";
cin>>start->m_m;
cout<<"\nmarks in english out of 100 : ";
cin>>start->e_m;
cout<<"\nmarks in computer science out of 100 : ";
cin>>start->cs_m;
temp->nxt=NULL;
cur->nxt=temp;
}
outFile.write((char *) &rec, sizeof(rec));
outFile.close();
cout<<"\n\nStudent record Has Been Created ";
getch();
}
void display_all()
{
node rec;
ifstream inFile;
inFile.open("student.txt",ios::binary);
if(!inFile)
{
cout<<"File could not be open ! Press any Key...";
getch();
return;
}
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !\n\n";
while(inFile.read((char *) &rec, sizeof(rec)))
{
cur=start;
while(cur->nxt!=NULL)
{
cout<<"\nRoll number of student : "<<cur->roll_no;
cout<<"\nStudentname of student : "<<cur->name;
cout<<"\nMarks in Physics : "<<cur->p_m;
cout<<"\nMarks in Chemistry : "<<cur->c_m;
cout<<"\nMarks in Maths : "<<cur->m_m;
cout<<"\nMarks in English : "<<cur->e_m;
cout<<"\nMarks in Computer Science :"<<cur->cs_m;
cout<<"\nPercentage of student is :"<<cur->per;
cout<<"\nGrade of student is :"<<cur->grade;
void display_sp(int n)
{
node rec;
student st;
ifstream inFile;
inFile.open("student.txt",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
cur=start;
while(inFile.read((char *) &rec, sizeof(rec)))
{
if( cur->roll_no==n)
{
cout<<"\nRoll number of student : "<<cur->roll_no;
cout<<"\nStudentname of student : "<<cur->name;
cout<<"\nMarks in Physics : "<<cur->p_m;
cout<<"\nMarks in Chemistry : "<<cur->c_m;
cout<<"\nMarks in Maths : "<<cur->m_m;
cout<<"\nMarks in English : "<<cur->e_m;
cout<<"\nMarks in Computer Science :"<<cur->cs_m;
cout<<"\nPercentage of student is :"<<cur->per;
cout<<"\nGrade of student is :"<<cur->grade;
void class_result()
{
node rec;
student st;
ifstream inFile;
inFile.open("student.txt",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
cout<<"\n\n\t\tALL STUDENTS RESULT \n\n";
cout<<"==========================================================\n";
cout<<"R.No Studentname P C M E CS %age Grade"<<endl;
cout<<"==========================================================\n";
char ch;
int rno;
cout<<"\n\n\n\tRESULT MENU";
cout<<"\n\n\n\t1. Class Result";
cout<<"\n\n\t2. Student Report Card";
cout<<"\n\n\t3. Back to Main Menu";
cout<<"\n\n\n\tEnter Choice (1/2/3)? ";
cin>>ch;
switch(ch)
{
case '1' :class_result(); break;
case '2' :cout<<"\n\n\tEnter Roll Number Of Student : ";
cin>>rno;
display_sp(rno); break;
case '3' :break;
default :cout<<"\a";
}
}
void intro()
{
cout<<"\n\n\t\tSTUDENT REPORT CARD SYSTEM ";
getch();
}
void entry_menu()
{
int num;
char ch;
cout<<"\n\n\n\tENTRY MENU";
cout<<"\n\n\t1.ADD STUDENT RECORD";
cout<<"\n\n\t2.DISPLAY ALL RECORDS";
cout<<"\n\n\t3.SEARCH STUDENT RECORD ";
cout<<"\n\n\t4.EDIT STUDENT RECORD";
cout<<"\n\n\t5.DELETE STUDENT RECORD";
cout<<"\n\n\t6.BACK TO MAIN MENU";
cout<<"\n\n\tPlease Enter Your Choice (1-6) ";
cin>>ch;
switch(ch)
{
case '1': write_student(); break;
case '2': display_all(); break;
case '3': cout<<"\n\n\tPlease roll number "; cin>>num;
display_sp(num); break;
/* case '4': cout<<"\n\n\tPlease roll number "; cin>>chose->num;
modify_student(chose->num);break;
case '5': cout<<"\n\n\tPlease roll number "; cin>>num;
delete_student(num);break;*/
case '6': break;
default: cout<<"\a"; entry_menu();
}
}