Вы находитесь на странице: 1из 77

PROJECT REPORT

ON
CHAT SERVER
SUBMITTED BY
BABLU KUMAR
VISHAL VERMA
GAURAV JUYAL
ARJUN SAINI

SUBMITTED TO
MISS REKHA HARIT

DAV (PG) COLLEGE DEHRADUN


ACKNOWLEDGEMENT

I am very grateful to Miss Rekha Harit who gave me support


each time I needed help, she was instrumented in finishing my
work. I am also thankful to the centre director faculty members and
my friends. To accomplish my work the main inspirational force are
my parents, brother and my sisters who were very helpful and are
constant critic.

YOURS SINCERELY

BABLU KUMAR
VISHAL VERMA
GAURAV JUYAL
ARJUN SAINI

2
CERTIFICATE

This is to certify that BABLU KUMAR , VISHAL VERMA , GAURAV JUYAL,

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.

Signature of Guide/ Supervisor.

NAME: MISS REKHA HARIT


DESIGNATION: FACULTY
PLACE: DEHRADUN
DATE:

3
4
SCOPE OF THE PROJECT

The project SCHOOL MANAGEMENT SYSTEM is


designed for the school management. This project is a tool for
school management for better administration and to manage its
various activities. The program will reduce manpower and
paperwork in administrative work. The student, teacher, subject
record can be easily stored, used, changed, and retrieved. All the
information will be displayed and the key person can utilized the
information as per the needs. Student information on admission
and class record can be stored, seen, and amended as per
requirement. Similarly the records of the teacher, there workload
and their output can also recorded and seen. Regular school
administrative work can be stored used for efficiency and time
management. The program is essentially a tool for school's better
administration and management.

5
TOOLS & ENVIORNMENT
USED

6
Windows 98

Windows 98 is a complete 32-bit operating system. The goal-


oriented approach is a significant part of the Windows 98
environment. As an operating system, Windows 98
Eliminate the need for DOS and creates the links between
user and the computer hardware by providing an interface
through which the user can communicate with the computer
Include all the core functionality of DOS, also improves on the
core by replacing old 16-bit DOS component with 32-bit
alternatives.
Provides a series of utilities and commands that can be used
to manage files folders and disks.
Offers GUI, which uses dialog boxes, pictures, symbols,
windows and words on the screen that can be controlled using
the mouse.
The ability to display several documents and run a number of
programs in their own windows, all at the same time.
Incorporates built-in programs, including a simple word
processor WordPad and drawing program paint.

7
About 'C' language

C was an offspring of the 'Basic combined programming


language' (BCPL) called B, developed in the 1960's at
Cambridge University. B language was modified by Dennis
Ritchie and was implemented at Bell laboratories in 1972.The
new language was named C. Since it was developed along
with the UNIX operating system, it is strongly associated with
UNIX. This operating system, which was also developed at
bell laboratories, was coded almost entirely in C.

8
FEASIBILITY STUDY

A Feasibility study is a test of system proposal according


to its workability, impact on organization, ability to meet user
needs and effective use of resources. The objective of the
feasibility study is not to solve the problem but to acquire a
range of its scope. During the study, the problem definition is
crystallized and aspect of the problem to be included in the
system is determined. The result of the feasibility study is a
formal proposal. This is simply a report a formal document
dealing the nature and scope of the proposed solution. After
the management reviews the proposal, it becomes a formal
agreement that paves the way for actual design and
implementation.

Economic Feasibility

The software is of very low cost. The installation cost of the


software is economical.
Technical 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.

HARDWARE AND SOFTWARE REQUIREMENT

Environment Used

Processor PIII (600Mz)

Hard disk 40GB

Ram 256MB

Motherboard Intel original chipset

Operating system windows 98

Language 'C'

10
System Analysis and Design

System analysis and design refers to the process of examining


a business situation with the intent to improving it through
better procedure and method. System developments can
generally having two major components - system analysis and
system design. System design is the process of planning a new
business system or one to replace or complement an existing
system. System analysis is the process of gathering and
interpreting facts, diagnosing problem, and using information to
recommend improvement to the system.

11
COST AND BENEFIT ANALYSIS

Cost/Benefit analysis is performed to ascertain whether


the cost in the system match with the benefit it will
provide. The various kinds of cost incurred in the
development and implementation of the system include:

Hardware Cost is around 23000.

Personal Cost includes the expenses of electricity and


conveyance is 3000.

Supply Cost variable costs that increase with increased use


of paper, ribbon, disks etc. This costs around 1000.

12
13
Entity Relationship Diagram

E-R Diagram is a diagrammatic representation of what


data can be attributed to an entity and what various
relationships may be shared between entities.

Entity and Attributes:- Entity is anything in a system, which


may be attributed by a set of attributes which define the
characteristics of the entity. For example students name, age,
roll no etc. are attributes that characterised the entities.

Relationship: - Entity does not exist independently: they


depend on each other. They relate to each other. For example a
teacher teaches students. The teacher and student are nouns
and hence are entities, teaches is a verb, and it is a
relationship between the teacher and the student.

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

A DFD, also known as a bubble chart, serves the purpose


of clarifying system requirements and identifying major
transformation that will become programmes in system design.
So it is the starting point of the design phase that functionally
decomposes the requirements specification down to the lowest
level of detail. A DFD consist of a series of bubbles joined by
lines. The bubbles represent data transformation and lines
represent data flows in the system. The DFD is a representation
of various processes and the input and output in each process.
A DFD describes data flow rather than how they are processed,
so it does not depend on the hardware, software data structure
or file organisation.

Naming Conventions in DFD: - Each component in a data


flow diagram is labelled with a descriptive name. Process names
are further identified with a number that will be used for
identification purposes. The number assign to a specific process
does not represent the sequence of processes. It is strictly for
identification and will take on added value when we study the
components that make up a specific process. The name of the
processes must clearly explain the actual task being performed
in the process.

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.

Level 1 and Higher level DFD: - When we explode the


context diagram and the break the single process into a number
of detailed process, then level 1 DFD is created. Further
breaking of each process leads to further level of DFDs. The
numbering convention in the DFD is as follows:

In the context diagram, no number is given to the


process, as only one process exists.

In the level 1 DFD, the processes are numbered as


1,2,3.
In the next level, the processes are numbered
depending on which process has been broken. For eg. If
process 2 of level 1. DFD is broken; the processes are
numbered as 2.1, 2.2 and so on.

17
The rules of thumb in drawing DFDs are:

1. Process should be named and numbered for easy


reference. Each name should be representative of the
process.

2. The direction of the flow is from the top to bottom and


from left to right. Data traditionally flows from the source
to the destination, although they may flow back to a
source. An alternative way is to repeat the source symbol
as a destination.

3. When the process is exploded into lower level details, they


are numbered on the basis of their parent process number.

4. The names of data stores, sources, destinations must be in


capital letters while the names of processes and data flow
must start with a capital letter.

18
//struc
ture for the student record

//Variables

Name //student name

R_no //roll no of the student

Clas //class

Fee //fees

Stud_add_record //structure for student admission record

Reg no registration number

Name name

Add address

Fname father name

Clas class

F_occ father occupation

Rem remarks

19
Tname teacher name

Teacher //structure for teacher record

Sub subject

Sal //salary

Class //structure for class and subject record

Tname //Teacher name

Sub //subject

Time //timing of the class

Clas //class

20
MAIN MENU
1.Information about student

2.Information about student admission record

3.Information about teaching staff

4.Input Records

5.Report

6.Exit

Enter your choice

21
STUDENT MENU

1.Add a new record

2.Display records

3.Delete a record

4.Modify

5.Search

6.Main Menu

Enter your choice

22
STUDENT ADDMISSION SUB-MENU

1.add a new record

2.display student admission record

3.delete a record

4.modifying record

5.search a record

6.Exit

Enter your choice

Teacher Menu

23
1.Add a new record

2.Display records

3.Delete a record

4.Modify teacher record

5.Search

6.Main Menu

Enter your
choice

Subject menu

1.Add a new Record

24
2.Display Records

3.modify subject Record

4.Main Menu

Enter
your choice

Student Record of student having Roll no 5

Roll No : 5

25
Student name : AMIT

Class : 5th

Fee : 350

Student Record of student having roll-no 45

26
Roll No : 45

Student name : SUMIT

Class : 11th

Fee : 500

Student admission record

Registration no of the student : 105

Name of the student : AMIT

27
Date of birth of the student : 02/02/1990

Address of the student : DEHRADUN

Father Name of the student : Mr Jeet Singh

Father occupation of the student : Teacher

Previous school of the student : none

Class of the student : 5th

Date of leaving the school :

Remarks :

Teacher : Manoj sharma


Subject : MATHS
Class : 5
Time: : 11:00-11:45

28
Teachers name who teaches PHYSICS are:

Teacher class Time

Manoj Sharma 5th 11.00 to 11.45

29
Want to continue (y/n)? :

30
CODING

#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<graphics.h>

// structure definition of student


struct stud
{
int rno,fee;
char name[20],sclass[20];
};
struct stud s[20];

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",&regno);

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.

Program Testing: - A program represents the logical elements


of a system. For a program to run satisfactorily, it must compile
and test data correctly and tie in properly with other programs.

System Testing or Validation: -System testing design to


uncover the weaknesses that were not found in earlier test. This
includes forced system failure and validation of total system, as
its user(s) in the operational environment will implement it.

75
IMPLEMENTATION

The phase of implementation includes installation of hardware and


software. When the system has been designed and tested, it need to be
implemented.

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

Computer Graphics Yashwant Kanetkar

77

Вам также может понравиться