






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
12th Class Computer Science Study Notes
Typology: Study notes
1 / 38
This page cannot be seen from the preview
Don't miss anything!































during the year of2018-19 in partial fulfillment of computer science practical examination conducted by N.G International school, Mehsana. ________________ _______________ SIGNATURE OF EXTERNAL SIGNATURE OF INTERNAL EXAMINER EXAMINER _____________
In the accomplishment of this project successfully, many people have best owned upon me their blessings and the heart pledge support, this time I am utilizing to thank all the people who have been concerned with this project. Primarily I would like thank god for being able to complete this project with success. Then I would like to thank my
Header Files Used:
2) #include
Objects of class fstream have both. 3) #include
#include
else if(per>=60) grade='B'; else if(per>=50) grade='D'; else if(per>=40) grade='E'; else grade='F'; } void student::getdata() { cout<<"\nEnter The roll number of student "; cin>>rollno; cout<<"\n\nEnter The Name of student "; cin.ignore(); cin.getline(name,50); cout<<"\nEnter The marks in physics out of 100 : "; cin>>p_marks; cout<<"\nEnter The marks in chemistry out of 100 : "; cin>>c_marks; cout<<"\nEnter The marks in maths out of 100 : ";
cin>>m_marks; cout<<"\nEnter The marks in english out of 100 : "; cin>>e_marks; cout<<"\nEnter The marks in computer science out of 100 : "; cin>>cs_marks; calculate();
int student::retrollno() const { return rollno; } void write_student(); //write void display_all(); //read void display_sp(int); //accept rolno and read record void modify_student(int); //accept rolno and update record OF FILE void delete_student(int); //accept rolno and delete selected records void class_result(); //display all records void result(); //display result void entry_menu(); //entry // THE MAIN FUNCTION OF PROGRAM int main() { char ch;
cout.setf(ios::fixed|ios::showpoint); cout<<setprecision(2); // program outputs decimal number to two decimal places cout<<"\n\n\n\t\t STUDENT"; cout<<"\n\n\t\tREPORT CARD"; cout<<"\n\n\t\t PROJECT"; cout<<"\n\n\n\tMADE BY : AKSHAT & VIREN"; cout<<"\n\tSCHOOL : N.G International SCHOOL"; do { cout<<"\n\n\n\tMAIN MENU"; cout<<"
n\n\t01. RESULT MENU"; cout<<"\n\n\t02. ENTRY/EDIT MENU"; cout<<"\n\n\t03. EXIT"; cout<<"\n\n\tPlease Select Your Option (1-3): "; cin>>ch; switch(ch) { case '1': result(); break; case '2': entry_menu(); break; case '3':
student st; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n"; while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student))) { st.showdata(); cout<<"\n\n============================================ =======================\n"; } inFile.close(); cin.ignore(); cin.get();
void display_sp(int n) { student st; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } bool flag=false; while(inFile.read(reinterpret_cast<char *> (&st), sizeof(student))) { if(st.retrollno()==n)
cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return; } while(!File.eof() && found==false) { File.read(reinterpret_cast<char > (&st), sizeof(student)); if(st.retrollno()==n) { st.showdata(); cout<<"\n\nPlease Enter The New Details of student"<<endl; st.getdata(); intpos=(-1)static_cast
found=true; } } File.close(); if(found==false) cout<<"\n\n Record Not Found "; cin.ignore(); cin.get(); } // FUNCTION TO DELETE RECORD OF FILE voiddelete_student(int n) { studentst; ifstreaminFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; cin.ignore(); cin.get(); return;