Академический Документы
Профессиональный Документы
Культура Документы
ON
CHAT SERVER
SUBMITTED BY
BABLU KUMAR
VISHAL VERMA
GAURAV JUYAL
ARJUN SAINI
SUBMITTED TO
MISS REKHA HARIT
YOURS SINCERELY
BABLU KUMAR
VISHAL VERMA
GAURAV JUYAL
ARJUN SAINI
2
CERTIFICATE
ARJUN SAINI worked on project entitled CHAT SERVER using JAVA under my
supervision.
This work done by the project members is originate and never been used for any
other purpose.
3
4
SCOPE OF THE PROJECT
5
TOOLS & ENVIORNMENT
USED
6
Windows 98
7
About 'C' language
8
FEASIBILITY STUDY
Economic Feasibility
9
Technical feasibility centers on the existing computer system
(hardware and software etc.). The cost of the hardware is
around 23000 and software is around 3500.
Environment Used
Ram 256MB
Language 'C'
10
System Analysis and Design
11
COST AND BENEFIT ANALYSIS
12
13
Entity Relationship Diagram
14
Modality: - The relationship between two entities may be one-
to-many, many-to-one. This property of a relation is known as
modality the relation.
15
Data Flow Diagram
16
Context Diagram: -The context diagram is the top level DFD.
It is presents a system as a single process with only major
input and outputs to the system represented as a data flows.
The source and the destination of the data as external entities
are also represented.
17
The rules of thumb in drawing DFDs are:
18
//struc
ture for the student record
//Variables
Clas //class
Fee //fees
Name name
Add address
Clas class
Rem remarks
19
Tname teacher name
Sub subject
Sal //salary
Sub //subject
Clas //class
20
MAIN MENU
1.Information about student
4.Input Records
5.Report
6.Exit
21
STUDENT MENU
2.Display records
3.Delete a record
4.Modify
5.Search
6.Main Menu
22
STUDENT ADDMISSION SUB-MENU
3.delete a record
4.modifying record
5.search a record
6.Exit
Teacher Menu
23
1.Add a new record
2.Display records
3.Delete a record
5.Search
6.Main Menu
Enter your
choice
Subject menu
24
2.Display Records
4.Main Menu
Enter
your choice
Roll No : 5
25
Student name : AMIT
Class : 5th
Fee : 350
26
Roll No : 45
Class : 11th
Fee : 500
27
Date of birth of the student : 02/02/1990
Remarks :
28
Teachers name who teaches PHYSICS are:
29
Want to continue (y/n)? :
30
CODING
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<graphics.h>
31
int st_count_add=0;
void write_stu()
{
FILE *fp;
int i=0;
fp=fopen("student1.dat","w");
for(i=0;i<st_count_add;i++)
{
fwrite(&s[i],sizeof(s[i]),1,fp);
}
fclose(fp);
}
void read_stu()
{
FILE *fp;
fp=fopen("student1.dat","r");
while(fread(&s[st_count_add],sizeof(s[st_c
ount_add]),1,fp)==1)
st_count_add++;
fclose(fp);
}
//structure definition for student
addmission record
struct stud_add_reg
{
int reg_no;
char name[20],fname[20],d_o_b[11];
char add[20],f_occ[20];
char pre_school[20],r_tc[10],rem[15];
char
d_o_pass[11],l_date[11],add_class[10];
32
};
struct stud_add_reg ss[20];
int c=0;
void write()
{
FILE *fp;
int i=0;
fp=fopen("s_add","wb");
for(i=0;i<c;i++)
{
fwrite(&ss[i],sizeof(ss[i]),1,fp);
}
fclose(fp);
}
oid read()
{
FILE *fp;
fp=fopen("s_add","rb");
while(fread(&ss[c],sizeof(ss[c]),1,fp)==1)
c++;
fclose(fp);
}
//structure definition for the subject
struct sub
{
char sub[20],tname[20],time[20];
char clas[10];
}sb[20];
int sb_count=0;
void wr()
{
33
FILE *fp;
int i=0;
fp=fopen("subject1.dat","wb");
for(;i<sb_count;i++)
{
fwrite(&sb[i],sizeof(sb[i]),1,fp);
}
fclose(fp);
}
void rd()
{
FILE *fp;
fp=fopen("subject1.dat","rb");
while(fread(&sb[sb_count],sizeof(sb[sb_cou
nt]),1,fp)==1);
fclose(fp);
}
// structure defination of the teaching
staff
struct teaching_staff
{
int empno;
char name[20],add[20];
char sub[16],qual[10];
int sal,exp;
};
struct teaching_staff t[20];
int t_count=0;
void write_teacher()
{
FILE *fp;
34
int i=0;
fp=fopen("teacher2.dat","w");
for(i=0;i<t_count;i++)
{
fwrite(&t[i],sizeof(t[i]),1,fp);
}
fclose(fp);
}
void read_teacher()
{
FILE *fp;
fp=fopen("teacher2.dat","r");
while(fread(&t[t_count],sizeof(t[t_count])
,1,fp)==1)
t_count++;
fclose(fp);
}
void colscreen()
{
clrscr();
textcolor(RED);
textbackground(GREEN);
clrscr();
textcolor(BLUE);
textbackground(YELLOW);
}
void add()
{
int rollno,flag=0,i=0;
35
char ans='y';
clrscr();
textcolor(BLUE);
textbackground(YELLOW);
while(ans=='y'||ans=='Y')
{
clrscr();
do
{
flag=0;
clrscr();
printf("\n\n");
printf("\n\n Enter roll no of the
student : ");
fflush(stdin);
scanf("%d",&rollno);
for(i=0;i<st_count_add;i++)
{
if(s[i].rno==rollno)
{
printf("\n\n This roll no already
exist please enter new roll no.");
printf("\n\n\n\t\t\t PRESS ANYKEY
");
getch();
flag=1;
}
}
}while(flag==1);
s[st_count_add].rno=rollno;
36
printf("\n Enter name of the student
: ");
fflush(stdin);
gets(s[st_count_add].name);
printf("\n Enter class of the student
: ");
fflush(stdin);
gets(s[st_count_add].sclass);
printf("\n Enter fee :
");
fflush(stdin);
scanf("%d",&s[st_count_add].fee);
st_count_add++;
printf("\n\n\n\t\t Do you want to add
any student data Press (Y/N): ");
ans=getch();
}
}
void display()
{
int i;
clrscr();
textcolor(BLUE);
textbackground(YELLOW);
printf("\n\n\n STUDENT RECORD\n\n ");
for(i=0;i<st_count_add;i++)
{
clrscr();
printf("\n\n\n\t\t Student Record of
student having rollno%d",s[i].rno);
37
printf("\n\n\n");
printf("\n\t\t Roll No :
%d",s[i].rno);
printf("\n\n\t\t Student name :
%s",s[i].name);
printf("\n\n\t\t Class :
%s",s[i].sclass);
printf("\n\n\t\t Fee :
%d",s[i].fee);
printf("\n\n");
getch();
}
}
void del_stud()
{
int roll_no,i=0;
clrscr();
textbackground(YELLOW);
textcolor(BLUE);
printf("\n\n\n\t Enter roll no of the
student to be deleted : ");
scanf("%d",&roll_no);
for(i=0;i<st_count_add;i++)
{
if(s[i].rno==roll_no)
{
s[i].rno=s[i+1].rno;
strcpy(s[i].name,s[i+1].name);
strcpy(s[i].sclass,s[i+1].sclass);
s[i].fee=s[i+1].fee;
}
38
}
st_count_add--;
}
void modify()
{
char x[6][15]={"roll
no","name","class","fee"};
int i,roll_no,flag=0;
char y[15];
textbackground(YELLOW);
textcolor(BLUE);
clrscr();
printf("\n\n\t Enter roll no of the
student to be modify : ");
scanf("%d",&roll_no);
for (i=0;i<st_count_add;i++)
{
if(s[i].rno==roll_no)
{
clrscr();
printf("\n\t Record found\n\n");
printf("\n\n\t Rollno :
%d",s[i].rno);
printf("\n\n\t Name
: %s",s[i].name);
printf("\n\n\t Class :
%s",s[i].sclass);
printf("\n\n\t Fee
: %d",s[i].fee);
printf("\n\n");
39
printf("\n The available fields
are :");
printf("\n 1.Name\n\t
2.class\n\t 3.Roll no\n\t ");
printf("4.Attendence");
printf("\n\n\t Type the field u want
to change :");
fflush(stdin);
gets(y);
if(strcmp(x[0],y)==0)
{
clrscr();
printf("\n\n\n\t Enter new rollno :
");
scanf("\n%d",&s[i].rno);
}
else if(strcmp(x[1],y)==0)
{
clrscr();
printf("\n\n\n\t Enter new name :
");
fflush(stdin);
gets(s[i].name);
}
else if(strcmp(x[2],y)==0)
{
clrscr();
printf("\n\n\n\t Enter new class :
");
fflush(stdin);
gets(s[i].sclass);
40
}
else if(strcmp(x[3],y)==0)
{
clrscr();
printf("\n\n\n\t Enter Fee :");
scanf("%d",&s[i].fee);
}
flag=1;
}
}
if(flag==0)
printf("\n\n\t RECORD NOT FOUND");
}
void search()
{
int roll_no,i,flag=0;
textbackground(YELLOW);
textcolor(BLUE);
clrscr();
printf("\n\n\n\t Enter roll no of the
student ");
scanf("%d",&roll_no);
for(i=0;i<st_count_add;i++)
{
if(s[i].rno==roll_no)
{
printf("\n\n\t RECORD FOUND\n\n");
printf("\n\n\n\t Student Record having
roll no %d is :\n",s[i].rno);
41
printf("\n\n\t Name :
%s",s[i].name);
printf("\n\n\t Class :
%s",s[i].sclass);
printf("\n\n\t Fee :
%s",s[i].fee);
getch();
flag=1;
}
}
if(flag==0)
printf("\n NOT FOUND");
}
void add_reg()
{
int rno,flag=0,i=0;
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
do
{
flag=0;
printf("\n\n\t Enter registration number
of the student :");
scanf("%d",&rno);
for(i=0;i<c;i++)
{
if(ss[i].reg_no==rno)
{
42
printf("\n This registration no
already exist please enter new roll no.");
flag=1;
}
}
}while(flag==1);
ss[c].reg_no=rno;
printf("\n\t Enter Name no of the student
:");
fflush(stdin);
gets(ss[c].name);
printf("\n\t Enter date of birth of the
student(dd/mm/yy) :");
fflush(stdin);
gets(ss[c].d_o_b);
printf("\n\t Enter Address of the student
:");
fflush(stdin);
gets(ss[c].add);
printf("\n\t Enter Father Name of the
student :");
fflush(stdin);
gets(ss[c].fname);
printf("\n\t Enter father occuption of
the student :");
fflush(stdin);
gets(ss[c].f_occ);
printf("\n\t Enter previos school of the
student :");
fflush(stdin);
gets(ss[c].pre_school);
43
printf("\n\t Enter class of the student
:");
fflush(stdin);
gets(ss[c].add_class);
printf("\n\t Enter date of leaving the
school(dd/mm/yy) :");
fflush(stdin);
gets(ss[c].l_date);
// printf("\n Enter reason for
TC :");
// fflush(stdin);
// gets(ss[c].r_tc);
printf("\n\t Enter Remarks
:");
fflush(stdin);
gets(ss[c].rem);
c++;
}
void display_add_reg()
{
int i=0;
clrscr();
printf("\n\n\n\n\n\t\t STUDENT
ADDMISSION RECORD");
getch();
for(;i<c;i++)
{
clrscr();
printf("\n\n");
printf("\n\t Registration no of the
student : %d\n",ss[i].reg_no);
44
printf("\n\t Name of the student
: %s\n",ss[i].name);
printf("\n\t date of birth of the
student : %s\n",ss[i].d_o_b);
printf("\n\t Address of the student
: %s\n",ss[i].add);
printf("\n\t Father Name of the student
: %s\n",ss[i].fname);
printf("\n\t Father occuption of the
student : %s\n",ss[i].f_occ);
printf("\n\t Previos school of the
student : %s\n",ss[i].pre_school);
printf("\n\t Class of the student
: %s\n",ss[i].add_class);
printf("\n\t Date of leaving the school
: %s\n",ss[i].l_date);
// printf("\n Reason for TC :
%s\n",ss[i].r_tc);
printf("\n\t Remarks :
%s\n",ss[i].rem);
getch();
}
}
void del_add_reg()
{
int regno,i;
textcolor(BLUE);
textbackground(YELLOW);
printf("\n\n\t Enter reg no of the
student");
scanf("%d",®no);
45
for(i=0;i<c;i++)
{
if(ss[i].reg_no==regno)
{
ss[i].reg_no=ss[i+1].reg_no;
strcpy(ss[i].name,ss[i+1].name);
strcpy(ss[i].d_o_b,ss[i+1].d_o_b);
strcpy(ss[i].add,ss[i+1].add);
strcpy(ss[i].fname,ss[i+1].fname);
strcpy(ss[i].f_occ,ss[i+1].f_occ);
strcpy(ss[i].pre_school,ss[i+1].pre_scho
ol);
strcpy(ss[i].add_class,ss[i+1].add_class
);
strcpy(ss[i].l_date,ss[i+1].l_date);
strcpy(ss[i].r_tc,ss[i+1].r_tc);
strcpy(ss[i].rem,ss[i+1].rem);
}
}
c--;
}
void modify_add_reg()
{
int i;
char name[20],y[20];
char f[10][20]={"reg
no","address","name","f_occ","class"};
textcolor(BLUE);
textbackground(YELLOW);
46
printf("\n\n\t\t Enter name of the
student :");
fflush(stdin);
gets(name);
for(i=0;i<c;i++)
{
if(strcmp(ss[i].name,name)==0)
{
clrscr();
printf("\n\n\t RECORD FOUND");
printf("\n\n");
printf("\n\t Registration no of the
student :%d\n",ss[i].reg_no);
printf("\n\t Name of the student
:%s\n",ss[i].name);
printf("\n\t date of birth of the
student :%s\n",ss[i].d_o_b);
printf("\n\t Address of the student
:%s\n",ss[i].add);
printf("\n\t Father Name of the
student :%s\n",ss[i].fname);
printf("\n\t Father occuption of the
student :%s\n",ss[i].f_occ);
printf("\n\t Previos school of the
student :%s\n",ss[i].pre_school);
printf("\n\t Class of the student
:%s\n",ss[i].add_class);
printf("\n\t Date of leaving the
school :%s\n",ss[i].l_date);
// printf("\n\t Reason for TC :
%s\n",ss[i].r_tc);
47
printf("\n\t Remarks
:%s\n",ss[i].rem);
getch();
printf("\n\tThe available fields
are :\n");
printf("\n\t 1.reg no\n\t 2.name\n\t
3.address");
printf("\n\t 4.f_occ(father
occption)\n\t 5.class");
printf("\n\t Type the field you want to
change : ");
fflush(stdin);
gets(y);
if(strcmp(f[0],y)==0)
{
clrscr();
printf("\n\n\t Enter new reg no of the
student :");
scanf("%d",&ss[i].reg_no);
}
else if(strcmp(f[1],y)==0)
{
clrscr();
printf("\n\n\t Enter new address :");
fflush(stdin);
gets(ss[i].add);
}
else if(strcmp(f[2],y)==0)
{
clrscr();
printf("\n\n\t Enter new name :");
48
fflush(stdin);
gets(ss[i].name);
}
else if(strcmp(f[3],y)==0)
{
clrscr();
printf("\n\n\t Enter father's new
occuption :");
fflush(stdin);
gets(ss[i].f_occ);
}
else if(strcmp(f[4],y)==0)
{
clrscr();
printf("\n\n\t Enter new class");
fflush(stdin);
gets(ss[i].add_class);
}
}
}
}
void search_add_reg()
{
char name[20];
int i=0,flag=0;
textcolor(BLUE);
textbackground(YELLOW);
printf("\n\n\n\t Enter name of the
student ");
fflush(stdin);
49
gets(name);
for(i=0;i<c;i++)
{
if(strcmp(ss[i].name,name)==0)
{
clrscr();
printf("\n\n\t Record Found");
printf("\n\n");
printf("\n\t Registration no of the
student : %d\n",ss[i].reg_no);
printf("\n\t Name of the student
: %s\n",ss[i].name);
printf("\n\t date of birth of the
student : %s\n",ss[i].d_o_b);
printf("\n\t Address of the student
: %s\n",ss[i].add);
printf("\n\t Father Name of the student
: %s\n",ss[i].fname);
printf("\n\t Father occuption of the
student : %s\n",ss[i].f_occ);
printf("\n\t Previos school of the
student : %s\n",ss[i].pre_school);
printf("\n\t Class of the student
: %s\n",ss[i].add_class);
printf("\n\t Date of leaving the school
: %s\n",ss[i].l_date);
// printf("\n\t Reason for TC :
%s\n",ss[i].r_tc);
printf("\n\t Remarks
: %s\n",ss[i].rem);
getch();
50
flag=1;
}
}
if(flag==0)
printf("\n RECORD NOT FOUND");
}
void teacher_add()
{
int emp_no,flag=0,i=0;
textcolor(BLUE);
textbackground(YELLOW);
closegraph();
clrscr();
do
{
flag=0;
printf("\n\n\n\t Enter employee no of
the teacher : ");
fflush(stdin);
scanf("%d",&emp_no);
for(i=0;i<t_count;i++)
{
if(t[i].empno==emp_no)
{
printf("\n This emloyee no already
exist please enter new roll no.");
flag=1;
}
}
}while(flag==1);
51
t[t_count].empno=emp_no;
printf("\n\t Enter name of the teacher
:");
fflush(stdin);
gets(t[t_count].name);
printf("\n\t Enter address of the teacher
:");
fflush(stdin);
gets(t[t_count].add);
printf("\n\t Enter subject
:");
fflush(stdin);
gets(t[t_count].sub);
printf("\n\t Enter experience
:");
scanf("%d",&t[t_count].exp);
printf("\n\t Enter salary
:");
scanf("%d",&t[t_count].sal);
printf("\n\t Enter qualification
:");
fflush(stdin);
gets(t[t_count].qual);
t_count++;
}
void display_teacher()
{
int i;
textcolor(BLUE);
textbackground(YELLOW);
52
clrscr();
printf("\n\n\n\t\tTeacher Record ");
for(i=0;i<t_count;i++)
{
clrscr();
printf("\n\n\n");
printf("\n\n\t Teacher name
: %s",t[i].name);
printf("\n\n\t Employee number :
%d",t[i].empno);
printf("\n\n\t Address :
%s",t[i].add);
printf("\n\n\t Subject for teaching
: %s",t[i].sub);
printf("\n\n\t Qualification
: %s",t[i].qual);
printf("\n\n\t Experience :
%d",t[i].exp);
printf("\n\n\t Salary :
%d",t[i].sal);
printf("\n\n");
getch();
}
closegraph();
}
void del_teacher_record()
{
int eno,i=0;
textcolor(BLUE);
textbackground(YELLOW);
53
printf("\n Enter employee no of the
teacher to be deleted : ");
scanf("%d",&eno);
for(i=0;i<t_count;i++)
{
if(t[i].empno==eno)
{
t[i].empno=t[i+1].empno;
strcpy(t[i].name,t[i+1].name);
strcpy(t[i].add,t[i+1].add);
strcpy(t[i].sub,t[i+1].sub);
t[i].sal=t[i+1].sal;
}
}
t_count--;
}
void modify_teacher_record()
{
char x[7][20]={"employee
no","name","address","subject","qualification","
salary","experience"};
int i,eno,flag=0;
char y[10];
textcolor(BLUE);
textbackground(YELLOW);
printf("\n Enter employee no of the
teacher to be modify");
scanf("%d",&eno);
for (i=0;i<t_count;i++)
{
54
if(t[i].empno==eno)
{
printf("\n\n\t Record found");
clrscr();
printf("\n\n");
printf("\n\t Emp no :
%d",t[i].empno);
printf("\n\t Name :
%s",t[i].name);
printf("\n\t Address :
%s",t[i].add);
printf("\n\t Subject :
%s",t[i].sub);
printf("\n\t Salary :
%d",t[i].sal);
printf("\n\t Qualification :
%s",t[i].qual);
printf("\n\n");
printf("\n The available fields
are :");
printf("\n 1.Name\n 2.Address\n
3.Employee no\n 4.Subject");
printf("\n 5.Salary\n
6.Qualification\n 7.Experience");
printf("\n\n Type the field u want to
change :");
fflush(stdin);
gets(y);
if(strcmp(x[0],y)==0)
{
clrscr();
55
printf("\n\n\t Enter new employee no
");
scanf("\n%d",&t[i].empno);
}
else if(strcmp(x[1],y)==0)
{
clrscr();
printf("\n\n\t Enter new name : ");
fflush(stdin);
gets(t[i].name);
}
else if(strcmp(x[2],y)==0)
{
clrscr();
printf("\n\n\t Enter new address ");
fflush(stdin);
gets(t[i].add);
}
else if(strcmp(x[3],y)==0)
{
clrscr();
printf("\n\n\t Enter new subject ");
fflush(stdin);
gets(t[i].sub);
}
else if(strcmp(x[4],y)==0)
{
clrscr();
printf("\n\n\t Enter qualification
");
fflush(stdin);
56
gets(t[i].qual);
}
else if(strcmp(x[5],y)==0)
{
clrscr();
printf("\n\n\t Enter new salary ");
fflush(stdin);
scanf("\n%d",&t[i].sal);
}
else if(strcmp(x[6],y)==0)
{
clrscr();
printf("\n\n\t Enter experience ");
fflush(stdin);
scanf("\n%d",&t[i].exp);
}
flag=1;
}
}
if(flag==0)
printf("\n RECORD NOT FOUND");
closegraph();
}
void search_teacher()
{
int emp_no,i,flag=0;
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
printf("\n\n\n\t Enter employee no of the
teacher :");
57
scanf("%d",&emp_no);
for(i=0;i<t_count;i++)
{
if(t[i].empno==emp_no)
{
clrscr();
printf("\n\tRECORD FOUND\n\n");
printf("\n\n Teacher Record having
employee no %d is :\n",t[i].empno);
printf("\n\n\t Teacher name :
%s",t[i].name);
printf("\n\n\t Address
: %s",t[i].add);
printf("\n\n\t Subject for teaching
: %s",t[i].sub);
printf("\n\n\t Qualification
: %s",t[i].qual);
printf("\n\n\t Experience
: %d",t[i].exp);
printf("\n\n\t Salary :
%d",t[i].sal);
getch();
flag=1;
}
}
if(flag==0)
printf("\n Not found");
closegraph();
}
void sb_add()
58
{
char ans='y';
textcolor(BLUE);
textbackground(YELLOW);
while(ans=='y'||ans=='Y')
{
printf("\n\n\n\t Enter subject
name :");
fflush(stdin);
gets(sb[sb_count].sub);
printf( "\n\n\t Enter Teacher
name :");
fflush(stdin);
gets(sb[sb_count].tname);
printf("\n\n\t Enter class :");
fflush(stdin);
gets(sb[sb_count].clas);
printf("\n\n\t Enter time of the
class(hh:mm):");
fflush(stdin);
gets(sb[sb_count].time);
sb_count++;
printf("\n Want to add more record(y/n)?
:");
fflush(stdin);
ans=getche();
}
}
void sb_disp()
{
59
int i=0;
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
for(;i<sb_count;i++)
{
clrscr();
printf("\n\n\n\n");
printf("\n Teacher
: %s",sb[i].tname);
printf("\n Subject
: %s",sb[i].sub);
printf("\n Class
: %s",sb[i].clas);
printf("\n time:
: %s",sb[i].time);
getch();
}
}
void sb_mod()
{
char x[4][20]={"subject","teacher
name","class","time"};
int i,flag=0;
char y[20];
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
printf("\n\n\n\t Enter teacher
name : ");
60
fflush(stdin);
gets(y);
for (i=0;i<sb_count;i++)
{
if(strcmp(sb[i].tname,y)==0)
{
printf("\n
Record found\n\n");
printf("\n\n
Teacher :
%s",sb[i].tname);
printf("\n\n
Subject :
%s",sb[i].sub);
printf("\n\n
Class :
%s",sb[i].clas);
printf("\n\n
time: :
%s",sb[i].time);
printf("\n\n");
printf("\n The available
fields are :");
printf("\n
1.subject\n 2.teacher name\n ");
printf("3.class\n
4.time");
printf("\n\n Type the
field u want to change :");
fflush(stdin);
gets(y);
61
if(strcmp(x[0],y)==0)
{
clrscr();
printf("\n\n\t\t
Enter new subject : ");
fflush(stdin);
gets(sb[i].sub);
}
else if(strcmp(x[1],y)==0)
{
clrscr();
printf("\n\n\t
Enter new name : ");
fflush(stdin);
gets(sb[i].tname);
}
else if(strcmp(x[2],y)==0)
{
clrscr();
printf("\n\n\t
Enter new class : ");
fflush(stdin);
gets(sb[i].clas);
}
else if(strcmp(x[3],y)==0)
{
clrscr();
printf("\n\n\t
Enter new time : ");
fflush(stdin);
gets(sb[i].time);
62
}
flag=1;
} }
if(flag==0)
printf("\n\n\n\t\t RECORD NOT
FOUND");
}
void t_rep()
{
int i;
char name[20],an;
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
printf("\n\n\t Enter Subject name :");
fflush(stdin);
gets(name);
printf("\n\n\t Teachers name who teaches
%s are :",name);
printf("\n\n\n\tTeacher\t\t class\t
Time\n");
for(i=0;i<sb_count;i++)
{
if(strcmp(name,sb[i].sub)==0)
{
printf("\n %s",sb[i].tname);
printf("\t\t%s",sb[i].clas);
printf("\t\t%s",sb[i].time);
}
printf("\n\n");
63
}
}
void c_rep()
{
int i=0;
char clas[20];
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
printf("\n Enter class :");
fflush(stdin);
gets(clas);
clrscr();
printf("\n\n\t Student of class %s
are :\n",clas);
for(i=0;i<st_count_add;i++)
{
if(strcmp(clas,s[i].sclass)==0)
{
printf("\n\t %s",s[i].name);
}
}
}
void ct_rep()
{
char name[20];
int i=0;
textcolor(BLUE);
textbackground(YELLOW);
clrscr();
64
printf("\n\n\n\t Enter teacher name :");
fflush(stdin);
gets(name);
clrscr();
printf("\n\n classes taught by %s are
:\n",name);
printf("\n\t class\t\t subject\t\t
time\n\n");
for(;i<sb_count;i++)
{
if(strcmp(name,sb[i].tname)==0)
{
printf("\t %s\t\t",sb[i].clas);
printf(" %s\t\t",sb[i].sub);
printf(" %s\t\t",sb[i].time);
}
}
}
void main()
{
int ch,i;
char ans='y';
read_stu();
read_teacher();
read();
rd();
while(1)
{
clrscr();
window(10,8,60,15);
colscreen();
65
printf("\n\n\n\n\t\t SCHOOL MANAGEMENT
SYSTEM");
printf("\n\n\n\t\t Developed by :
Gitika");
printf("\n\n\t\t\t PRESS ANYKEY ");
getch();
clrscr();
window(1,1,80,25);
clrscr();
textbackground(BLACK);
textcolor(RED);
closegraph();
printf("\n\n\n");
printf("\t\t\tMAIN MENU\n");
printf("\n\t 1.Information about
student\n");
printf("\n\t 2.Information about student
addmission record\n");
printf("\n\t 3.Information about
teaching staff\n");
printf("\n\t 4.Input Records\n");
printf("\n\t 5.Report\n");
printf("\n\t 6.Exit");
cprintf("\n\n\n\n\t\t\t\t\t\t Enter
your choice ");
scanf("%d",&ch);
ans='y';
switch(ch)
{
case 1:
66
textbackground(YELLOW);
textcolor(BLUE);
while(ans=='y'||ans=='Y')
{
clrscr();
printf("\n\n\t\t\t STUDENT MENU ");
printf("\n\n");
// printf("\n\t What do you want to do
with student record\n");
printf("\n");
printf("\n\t 1.Add a new record\n
");
printf("\n\t 2.Display records\n ");
printf("\n\t 3.Delete a record\n ");
printf("\n\t 4.Modify\n ");
printf("\n\t 5.Search\n ");
printf("\n\t 6.Main Menu\n ");
printf("\n\n\n\n\t\t\t\t\t Enter
your choice ");
scanf("%d",&i);
switch(i)
{
case 1:
add();
break;
case 2:
display();
break;
case 3:
del_stud();
break;
67
case 4:
modify();
break;
case 5:
search();
break;
}
clrscr();
printf("\n\n\n\t\t Do you want to
continue with student recored (Y/N) ");
fflush(stdin);
ans=getch();
}
break;
case 2:
textbackground(YELLOW);
textcolor(BLUE);
while(ans=='y'||ans=='Y')
{
clrscr();
// printf("\n\n what do you want to do
with student addmission record");
printf("\n\t student Addmission Sub-
Menu\n");
printf("\n\n\t 1.add a new record");
printf("\n\n\t 2.display student
addmission record");
printf("\n\n\t 3.delete a record");
printf("\n\n\t 4.modifying record");
printf("\n\n\t 5.search a
record\n\n\t 6.Exit");
68
printf("\n\n\t Enter your choice ");
scanf("%d",&ch);
switch(ch)
{
case 1:
add_reg();
break;
case 2:
display_add_reg();
break;
case 3:
del_add_reg();
break;
case 4:
modify_add_reg();
break;
case 5:
search_add_reg();
break;
case 6:
break;
}
printf("\n\n\n\t\t Want to continue
(y/n)?");
fflush(stdin);
ans=getch();
}
break;
case 3:
textbackground(YELLOW);
textcolor(BLUE);
69
while(ans=='y'||ans=='Y')
{
clrscr();
printf("\n\n\n");
// printf("\n What do u want to do
with teacher record\n");
printf("\n\t\t Teacher Menu\n");
printf("\n\t 1.Add a new record\n\n\t
2.Display records\n");
printf("\n\t 3.Delete a record\n\n\t
4.Modify teacher record\n");
printf("\n\t 5.Search\n\n\t 6.Main
Menu");
printf("\n\n\t Enter your
choice\t\t\t");
scanf("%d",&i);
switch(i)
{
case 1:
teacher_add();
break;
case 2:
display_teacher();
break;
case 3:
del_teacher_record();
break;
case 4:
modify_teacher_record();
break;
case 5:
70
search_teacher();
break;
case 6:
break;
}
printf("\n\t\t\t Want to
continue(y/n)?");
fflush(stdin);
ans=getch();
}
break;
case 4:
textcolor(BLUE);
textbackground(YELLOW);
while(ans=='y'||ans=='Y')
{
clrscr();
printf("\n\n\n");
printf("\n
Subject menu\n");
printf("\n\t
1.Add a new Record\n");
printf("\n\t
2.Display Records\n");
printf("\n\t
3.modify subject Record\n");
printf("\n\t
4.Main Menu");
printf("\n\n
Enter your choice\t\t\t");
71
scanf("%d",&i);
switch(i)
{
case 1:
sb_add();
break;
case 2:
sb_disp();
break;
case 3:
sb_mod();
break;
}
printf("\n want to
continue(y/n)? :");
fflush(stdin);
ans=getche();
}
break;
case 5:
textbackground(YELLOW);
textcolor(BLUE);
while(ans=='y'||ans=='Y')
{
clrscr();
printf("\n\n\n\n");
printf("\n\t REPORT MENU");
printf("\n\n\t 1.Teachers name
teaches a particular subject");
72
printf("\n\n\t 2.Student of a
specified class");
printf("\n\n\t 3.Classes taught by a
teacher");
printf("\n\n\t 4.Main menu");
printf("\n\n\t Enter your
choice :");
scanf("%d",&ch);
switch(ch)
{
case 1:
t_rep();
break;
case 2:
c_rep();
break;
case 3:
ct_rep();
break;
}
printf("\n\n\n\t\t Want to
continue(y/n)? :");
fflush(stdin);
ans=getche();
}
break;
case 6:
write_stu();
write_teacher();
write();
wr();
73
exit(0);
}
}
TESTING
74
Testing is vital to the success of a system. System testing
makes a logical assumption that if all part of the system are
correct, the goal will be successfully achieved.
75
IMPLEMENTATION
DIRECT IMPLEMENTATION
In the direct method, conversion from the old system to new system
takes place abruptly. The old system work finely, till one day it is replaced
by the new system. The software converts present system into
computerised system.
The system is followed for reducing paper work and manpower. It can
easily installed in our computer system and saves valuable time. The
system posses some desirable features like
Correctness
Reliability
Robustness
Performance
User friendliness and maintainability.
76
BIBLOGRAPHY
Book Author
Programming in E Balagurusamy
ANSII C
77