Student Management System C++ Program Class 12th
Student Management System C++ Program Class 12th
CERTIFICATE
PREFACE
ACKNOWLEDGEMENT
DEPARTMENT OF COMPUTER
CODING
OUTPUT
BIBLIOGRAPHY
REMARK SHEET
CERTIFICATE
It is to be certified to be the
bonafide work done by AMIT
RAJPUT of class 12th ‘A’ has
done this project school
management in the COMPUTER
laboratory during the year
2018-2019 in COMPUTER
SCIENCE subject in Jugal devi
saraswati vidya mandir ,deen
dayal nagar Kanpur.
AMIT RAJPUT
12 “A”
ACKNOWLEDGMENT
I“AMIT RAJPUT” A STUDENT OF CLASS 12TH,(A) EXPRESS
MY SINCERE GRATITUDE TO ALL MY TEACHER’S AND
EVERYONE WITHOUT WHOM MY PROJECT WOULD NOT
HAVE COME TO A BETTER SHAPE LIKE TODAY.
AMIT RAJPUT
12 , A
TH
ROLL NO.-____________
DEPARTMENT OF
COMPUTER
Name :- AMIT RAJPUT
Class&sec. :- 12th “A”
Roll no. :-________
School :-Jugal devi Saraswati
Vidya Mandir
Session :-2018-2019
H.O.D :-MrS. AMITA TIWARI
Sub. Teacher :- MRS. AMITA MA’AM
Lab instructor :-Mr. RAVI SIR
Head of InstT. :-Mr. HARI PRASAD
SHARMA
CODING
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<fstream.h>
struct student
{
char name[20];
char reg[15];
char course[10];
float cgpa;
};
fstream file;
student obj;
void add()
{
cout<<"Enter Name: ";
cin>>obj.name;
cout<<"Enter Registration Number: ";
cin>>obj.reg;
cout<<"Enter Course: ";
cin>>obj.course;
cout<<"Enter CGPA: ";
cin>>obj.cgpa;
file.open("database.txt",ios::app) ;
file.write((char*)&obj,sizeof(obj));
file.close();
}
void show_all()
{ // clrscr();
file.open("database.txt",ios::in);
file.read((char*)&obj,sizeof(obj));
while (file.eof()==0)
{
cout<<"Name: "<<obj.name<<endl;
cout<<"Registration Number:
"<<obj.reg<<endl;
cout<<"Course: "<<obj.course<<endl;
cout<<"CGPA: "<<obj.cgpa<<endl<<endl;
file.read((char*)&obj,sizeof(obj));
}
file.close();
getch();
}
void search()
{ // clrscr();
float user;
cout<<"Enter CGPA: ";
cin>>user;
file.open("database.txt",ios::in);
file.read((char*)&obj,sizeof(obj));
while (file.eof()==0)
{
if (obj.cgpa==user)
{
cout<<"Name: "<<obj.name<<endl;
cout<<"Registration Number:
"<<obj.reg<<endl;
cout<<"Course: "<<obj.course<<endl;
cout<<"CGPA: "<<obj.cgpa<<endl<<endl;
}
file.read((char*)&obj,sizeof(obj));
}
file.close();
getch();
}
void edit()
{ // clrscr();
char user[15];
cout<<"Enter registration Number: ";
cin>>user;
file.open("database.txt",ios::in|ios::out);
file.read((char*)&obj,sizeof(obj));
while (file.eof()==0)
{
if (strcmp(obj.reg,user)==0)
{
cout<<"Name: "<<obj.name<<endl;
cout<<"Registration Number:
"<<obj.reg<<endl;
cout<<"Course: "<<obj.course<<endl;
cout<<"CGPA: "<<obj.cgpa<<endl<<endl;
file.seekp(file.tellg()-sizeof(obj));
file.write((char*)&obj,sizeof(obj));
cout<<"\n\nFile Updated";
break;
}
file.read((char*)&obj,sizeof(obj));
}
file.close();
getch();
}
void main()
{
// clrscr();
//file.open("c:\database.txt",ios::out);
//file.close();
int option;
while(1)
{
// clrscr();
cout<<"Enter 1 to Enter Record\n";
cout<<"Enter 2 to Show All Record\n";
cout<<"Enter 3 to Search Record\n";
cout<<"Enter 4 to Exit\n";
cout<<"\n\nEnter Option: ";
cin>>option;
switch (option)
{
case 1:
add();
cout<<"\n\nRecord Entered\n";
getch();
break;
case 2:
show_all();
break;
case 3:
search();
break;
case 4:
exit(0);
}
}
getch();
}
OUTPUT
SUBJECT BOOK
www.icbse.com
TEACHER’S NOTES
WIKIPEDIA