C++ School Management
C++ School Management
Submitted by
ABIRAMI.C
Reg No:
Under the guidance of
MRS. K. SIVACHITRA MBA, M.Sc., B.Ed
PGTin COMPUTER SCIENCE
1|P ag e
BONAFIDE CERTIFICATE
This is to certify that the project work was done under the guidance
and this work entitled as “SCHOOL MANAGEMENT SYSTEM”
submitted by ABIRAMI.C to Chellappan Vidya Mandir International
School in partial fulfillment of the requirements for the award of
Higher Secondary- Second year during the year 2019-2020. Also
certified that this work has not been submitted in full or in part to
this school or any other institution.
PRINCIPAL GUIDE
Karaikudi Karaikudi
EXTERNAL EXAMINER
2|P ag e
DECLARATION
Date:
ABIRAMI.C
3|P ag e
ACKNOWLEDGEMENT
5|P ag e
CONTENTS
6|P ag e
ABSTRACT
ABSTRACT:
7|P ag e
School management system will be responsible for performing various actions
such as maintaining and managing student records, managing admission
details and setting admission criteria for admission into various stream for
particular classes, managing users who are working within the school,
preparing time tables and routines for the studying students and teachers,
providing online assistance help for the studying students, keeping parents
records and health records of students for future references. All these tasks
can be achieved easily through this new school management system. As
system has been developed by divining into several modules so maintenance
work can be easily carried out without the need of technical assistance.
To work with this system each users will have its unique id and password
through which they access this particular system. To manage and integrate
various modules and to eliminate the concept of data redundancy each
modules will have data sharing property with other modules as and when
required. For each module there will be unique for each of their members such
as family details of a particular students, student records, staff members
details, student class relationship, teacher, class and student relationship etc.
The main reason for providing unique id for each member of a particular
module is to developed a medium of fast identification to make our coding
more optimized for better performance.
8|P ag e
INTRODUCTION
9|P ag e
Introduction :
11 | P a g e
SYSTEM
ENVIRONMENT
12 | P a g e
SYSTEM ENVIRONMENT
Ram : 1.00 GB
13 | P a g e
2.3 Overview of C++
Abstraction
Encapsulation
Inheritance
Polymorphism
14 | P a g e
Features of Object Oriented C++
15 | P a g e
Standard Libraries in C++
C++ standard library was created after many years and it has
three important parts:
LEARNING C++:
16 | P a g e
Each style can achieve its aims effectively while maintaining
runtime and space efficiency.
Uses of C++:
C++ is used by programmers to create computer software. It
is used to create general systems software, drivers for
various computer devices, software for servers and software
for specific applications and also widely used in the creation
of video games.
C++ is used by many programmers of different types and
coming from different fields. C++ is mostly used to
write device driver programs,
System software and applications that depend on
direct hardware manipulation under real time constraints. It
is also used to teach the basics of object oriented features
because it is simple and is also used in the fields of research.
Also, many primary user interfaces and system files of
Windows and Macintosh are written using C++. So, C++ is
really a popular, strong and frequently used programming
language of this modern programming era.
17 | P a g e
2.4.1. CLASS AND OBJECT
The main purpose of C++ programming is to add object
orientation to the C programming language and classes are
the central feature of C++ that supports object-oriented
programming and are often called user-defined types.
A class is used to specify the form of an object and it
combines data representation and methods for manipulating
that data into one neat package. The data and functions
within a class are called members of the class.
Class Box
{
Public:
double length; // Length of a box
double breadth; //Breadth of a box
18 | P a g e
The keyword public determines the access attributes of the
members of the class that follow it. A public member can be
accessed from outside the class anywhere within the scope
of the object class as private or protected which we will
discuss in a sub-section
DEFINE C++ OBJECTS
Both of the objects Box1 and Box2 will have their own copy
of data members.
19 | P a g e
2.4.2. INHERITANCE
One of the most important concepts in object-oriented
programming is that of inheritance. Inheritance allows us to
define a class in terms of another class, which makes it easier
to create and maintain an application. This also provides an
opportunity to reuse the code functionality and fast
implementation time.
When creating a class, instead of writing completely new
data members and member functions, the programmer can
designate that the new class should inherit the members of
an existing class. This existing class is called the base class,
and the new class is referred to as the derived class.
The idea of inheritance implements the ‘is a’ relationship.
For example, mammal IS-A animal, dog IS-A mammal hence
dog IS-A animal as well and so on.
Base and Derived Classes
A class can be derived from more than one class, which
means it can inherit data and functions from multiple base
classes. To define a derived class, we use a class derivation
list to specify the base class (es). A class derivation list names
one or more base classes and has the form −
class derived-class: access-specifier base-class
20 | P a g e
2.4.3 FUNCTION OVERLOADING
C++ allows you to specify more than one definition for
a function name or an operator in the same scope, which is
called function overloading and operator
overloading respectively.
An overloaded declaration is a declaration that is declared
with the same name as a previously declared declaration in
the same scope, except that both declarations have different
arguments and obviously different definition
(implementation).
When you call an overloaded function or operator, the
compiler determines the most appropriate definition to use,
by comparing the argument types you have used to call the
function or operator with the parameter types specified in
the definitions. The process of selecting the most
appropriate overloaded function or operator is
called overload resolution.
21 | P a g e
2.4.4. DATA ENCAPSULATION
22 | P a g e
2.4.5 DATA ABSTRACTION
1 ofstream
This data type represents the output file stream and
is used to create files and to write information to
files.
2 ifstream
This data type represents the input file stream and
is used to read information from files.
3 fstream
This data type represents the file stream generally,
and has the capabilities of both ofstream and
ifstream which means it can create files, write
information to files, and read information from files.
24 | P a g e
A file must be opened before you can read from it or write
to it. Either ofstream or fstream object may be used to open
a file for writing. And ifstream object is used to open a file
for reading purpose only.
Following is the standard syntax for open() function, which is
a member of fstream, ifstream, and ofstream objects.
void open(const char *filename, ios::openmode mode);
1 ios::app
Append mode. All output to that file to be appended
to the end.
2 ios::ate
Open a file for output and move the read/write
control to the end of the file.
3 ios::in
Open a file for reading.
4 ios::out
Open a file for writing.
25 | P a g e
5 ios::trunc
If the file already exists, its contents will be
truncated before opening the file.
Similar way, you can open a file for reading and writing
purpose as follows −
fstream afile;
afile.open("file.dat", ios::out | ios::in );
CLOSING A FILE
When a C++ program terminates it automatically flushes all
the streams, release all the allocated memory and close all
the opened files. But it is always a good practice that a
programmer should close all the opened files before
program termination.
Following is the standard syntax for close() function, which is
a member of fstream, ifstream, and ofstream objects.
void close();
WRITING TO A FILE
26 | P a g e
While doing C++ programming, you write information to a
file from your program using the stream insertion operator
(<<) just as you use that operator to output information to
the screen. The only difference is that you use
an ofstream or fstream object instead of the cout object.
You read information from a file into your program using the
stream extraction operator (>>) just as you use that operator
to input information from the keyboard. The only difference
is that you use an ifstream or fstream object instead of
the cin object.
27 | P a g e
STUDY AND ANALYSIS OF SCHOOL
MANAGEMENT SYSTEM
28 | P a g e
System Analysis In this chapter the functional and non-
functional requirements of the system are described and
modeled using UML models.
1 Functional Requirements The functional requirements of
the system are: • register a student, • record attendance of
students, • generate various reports, • generate timetable.
2 Non Functional Requirements Security requirements are
important factors in this system as classified data will be
stored in the database. User validation will be done during
login to insure that the user is valid and that the user only
has access to his or her permission data. General users will
only have access through the user interface. The system will
have consistent interface formats and button sets for all
forms in the application, will have a form based interface for
all data entry and viewing formats, and will generate reports
that are formatted in a table and that should look like the
existing manual report formats for user friendliness. The
system will be easily maintained by the developer or other
authorized trained person and it shall respond as fast as
possible in generating report and producing the timetable. -
12 - 4.3 Analysis Model To produce a model of the system
which is correct, complete and consistent we need to
construct the analysis model which focuses on structuring
and formalizing the requirements of the system. Analysis
model contains three models: functional, object and dynamic
models. The functional model can be described by use case
29 | P a g e
diagrams. Class diagrams describe the object model. Dynamic
model can also be described in terms of sequence, state
chart and activity diagrams. For the purpose of this project
we have described the analysis model in terms of the
functional model and dynamic models using use case and
sequence diagrams.
Existing System:
Under the existing system there was no any medium to make direct
communication between parents and administration. To inform
about status and study reports to particular parents of a particular
student, administration have to write letter to make them inform.
Students have to check their notice board to get information about
details about their routine, exam time tables, about their results and
marks scored in particular exam subject wise. Working employees
and staff members have to visit their bank to check their payment
confirmation monthly.
Proposed System:
Through this new school management system all the work has been
made automated and replacing the process manual work load.
Through this new system, all working employees will able to check
their payment status and total number of working days or we can say
their attendance and deduction made from their salary and for what
purpose.
Students will able to check their results, time tables and routines by
going through their student dashboard. Administration will able to
30 | P a g e
send direct messages to the parent’s inbox by using their id and
parents will check those messages and apply directly to them. This
system will able to display notices and news or events which is going
to be held in their campus.
31 | P a g e
Dependability The school needs the system to be highly
dependable as it is expected to be used by nonIT
professionals. The system should be robust and fault
tolerant. Furthermore, as the system is handling sensitive
data of the school, high emphasis should be given with
regards to security, as there are subsystems to be accessed
through web.
Maintenance The system should be easily extensible to add
new functionalities at a later stage. It should also be easily
modifiable to make changes to the features and
functionalities
End User Criteria Usability: Usability is the extent to which a
product can be used by specified users to achieve specified
goals with effectiveness, efficiency and satisfaction in a
specified context of use. From the end users’ perspective the
system should be designed in such a way that it is easy to
learn and use, efficient and having few errors if any. Trade-
off is inevitable in trying to achieve a particular design goal.
One best case is the issue of security versus response time.
Checking User-Id and Password before a member can enter
to the SMS creates response time problem/overhead. The
other case is the issue of response time versus quality. There
is some amount of time taken by the system to generate the
timetable. So the user has to wait a little after telling the
system to generate the timetable and getting the result to
get a quality timetable. –
32 | P a g e
Architecture of the System The proposed system is expected
to replace the existing manual system by an automated
system in all facets. It is mainly based on the system Analysis
document (chapter 4). The architecture used for the system
is a 3 tier Client/Server Architecture where a client can use
Internet browsers to access the online report provided by the
system within the local area network of the school or any
where using the Internet.
. The data tier maintains the applications data such as
student data, teacher data, timetable data etc. It stores these
data in a relational database management system (RDBMS).
The middle tier (web/application server) implements the
business logic, controller logic and presentation logic to
control the interaction between the application’s clients and
data. The controller logic processes client requests such as
requests to view student’s result, to record attendance or to
retrieve data from the database. Business rules enforced by
the business logic dictate how clients can and cannot access
application data and how applications process data. A web
server is a program that runs on a network server (computer)
to respond to HTTP requests. The most commonly used web
servers are Internet Information Server (IIS) and Apache. The
web server used in this system is IIS. HTTP is used to transfer
data across an Intranet or the Internet. It is the standard
protocol for moving data across the internet. The client tier is
the applications user interface containing data entry forms
and client side applications. It displays data to the user. Users
33 | P a g e
interact directly with the application through user interface.
The client tier interacts with the web/application server to
make requests and to retrieve data from the database. It
then displays to the user the data retrieved from the server
Persistent Data Management
Persistent data management deals with how the persistent
data (file, database, etc) are stored and managed and it
outlives a single execution of the system. Information related
to student basic information, student’s attendance and grade
mark, the timetable produced and other related information
are persistent data and hence stored on a database
management system. This allows all the programs that
operate on the SMS data to do consistently. Moreover,
storing data in a database enables the system to perform
complex queries on a large data set The schools register
students every year in thousands per grade level. For
complex queries over attributes and large dataset Microsoft
SQL Server is implemented, which is a Relational Database
Management System.
34 | P a g e
DESIGN AND DEVELOPMENT OF
SCHOOL MANAGEMENT SYSTEM
35 | P a g e
36 | P a g e
37 | P a g e
38 | P a g e
39 | P a g e
40 | P a g e
41 | P a g e
42 | P a g e
CONCLUSION
43 | P a g e
Conclusion In this project, we developed an automated
school management system that facilitates the various
activities taking place at schools. The system developed in
the project consists of windows and web applications. These
are two different applications on the same database. The
windows application takes most of the activities such as
offline student registering, transcript and report card
generation and producing the timetable. The web application
facilitates attendance recording by the homeroom teachers
and to view reports, to view status of students by students,
teachers and parents. Our solution of the timetabling
problem is very simple. Data structures are used to
implement the timetable designed. The scheduler selects a
subject-teacher from the database, retrieves all the classes
assigned to the teacher, calculates the load of the teacher
which cannot be greater than the maximum load and selects
one of the days randomly based on the number of lessons of
the subject, searches a free appropriate time slot and assigns
the slot to the lesson. The scheduler repeats the process until
the load of the teacher becomes zero and all the teachers in
the database are visited. Finally the result generated is stored
in a database. The prototype has been tested with data from
Kokebe Tsebah Secondary School. It has been shown that the
system effectively registers students along with parental
information, easily retrieves information about a student and
generates the required reports such as transcript, report card
and timetable. In addition to generating a feasible master
44 | P a g e
timetable it produces a timetable for each teacher. Further
more it has been shown that the web application of the
system helps attendance recording by the homeroom
teacher and parents can view the status of their children
using the Internet or Intranet of the school.
45 | P a g e
BIBLIOGRAPHY
46 | P a g e
[1]E. Burke and W. Erben. Practice and Theory of Automated
Timetabling, Third International Conference, Germany,
Springer Private Limited, August 2000
[2]. J. G. Hedberg et. al. (1992). Educational information
systems: Problems of the small educational organisation.
Australian Journal of Educational Technology, 8(2), 132-160.
http://www.ascilite.org.au/ajet/ajet8/hedberg.html
[3]. M. Marte. Models and Algorithms for School
Timetabling, A Constraint-Programming Approach, Ph.D
dissertation, an der Fakult¨at f¨ur Mathematik, Informatik
und Statistik der Ludwig-Maximilians-Universit ¨at
M¨unchen, July, 2002
[4] R.J. Willemen. School Timetable Construction: Algorithms
and Complexity, Thesis, Faculty of Mathematics and
Computer Science, Technische Universiteit Eindhoven, 2002.
[5]. S. Petrovic and E. Burke. University Timetabling, School of
Computer Science and Information Technology, University of
Nottingham, 2002, pp. 1-4
[6] T. Willis and B. Newsome. Beginning Visual Basic 2005,
Wiley Publishing, Inc., 2006.
47 | P a g e
SOURCE CODE
48 | P a g e
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<iomanip.h>
#include<fstream.h>
#include<dos.h>
struct marks_criteria
{
int sc_min,com_min,arts_min, seat_sc, seat_com, seat_arts;
} crit;
struct administrator
{
char user_name[10];
char password[10];
}admin;
struct student
{
char name[20];
int regno,m_eng,m_math,m_sc,m_sst,m_lang;
int pref_code, stream;
// Sc=1, Com=2; Arts=3;
public:
void new_file();
void input_data();
void allot_stream();
int get_stream();
void display();
int show_per()
{
return((m_eng+m_math+m_sc+m_sst+m_lang)/5);
49 | P a g e
}
};
void welcome();
void menu();
int verify_password();
void assign_user();
void clear();
void input_criteria();
void read_criteria();
void read_student();
void create_eligible_sc();
void create_eligible_com();
void create_eligible_arts();
void read_eligible_sc();
void read_eligible_com();
void read_eligible_arts();
char * stream_name(int strm);
void select_list( char *in_file, char *out_file);
void thanks();
student s;
void main()
{
clrscr();
welcome();
// cout<<"welcome";
fstream fin, fout;
fstream fsc, fcom, farts;
int opt=1, ch;
while(opt!=8)
{
50 | P a g e
// clrscr();
clear();
cout<<"\n\t====================== MAIN MENU
=======================\n";
cout<<"\n\t[1] CREATE / MODIFY ADMISSION CRITERIA(Administrator
only)";
cout<<"\n\n\t[2] ENTER STUDENT'S DATA ";
cout<<"\n\n\t[3] ALLOTMENT OF STREAM";
cout<<"\n\n\t[4] DISPLAY CRITERIA FOR SELECTION";
cout<<"\n\n\t[5] DISPLAY ALLOTMENT OF STUDENT'S STREAM";
cout<<"\n\n\t[6] DISPLAY ALL STUDENT'S REGISTERED";
cout<<"\n\n\t[7] CREATE / DISPLAY MERIT LIST";
cout<<"\n\n\t[8] QUIT";
cout<<"\n\t================================================
====\n";
cout<<"\n\n\t\tEnter your choice : ";
cin>>opt;
switch(opt)
{
case 1:
int p;
assign_user();
p=verify_password();
if(p==0)
{
input_criteria();
}
else
{
cout<<"\n\tU R Not a Valid User.";
cout<<"\n\tU Dont have the Authority to Create Question
Bank. Bye\n\n";
}
break;
case 2:
int option;
clrscr();
51 | P a g e
cout<<"\nWhat do u want --\n\n\n\n\n\tCreate a new student
information file or Append to the existing file?\n\n\t(press 1 for new creation
and 2 for appending)";
cin>>option;
if(option==1)
{
s.new_file();
}
else
{
s.input_data();
}
break;
case 3:
clrscr();
// read_student();
fin.open("student" ,ios::in|ios::out);
fsc.open("elig_sc",ios::out);
fcom.open("eligcom",ios::out);
farts.open("eligart",ios::out);
while(fin.read((char*)& s,sizeof(s)))
{
s.allot_stream();
s.get_stream();
//if(s.get_stream()==0)
cout<<"\nApplication Rejected. Not Eligible\n";
if(s.get_stream()==1)
fsc.write((char*)& s,sizeof(s));
if(s.get_stream()==2)
fcom.write((char*)& s,sizeof(s));
52 | P a g e
if(s.get_stream()==3)
farts.write((char*)& s,sizeof(s));
fin.close();
fsc.close();
fcom.close();
farts.close();
cout<<"\n*******************************************";
cout<<"\n\n\tSTREAM ALLOCATION DONE.";
cout<<"\n*******************************************";
break;
case 4:
read_criteria();
// clear();
cout<<"\n Sc : "<<crit.sc_min;
cout<<"\n Com : "<<crit.com_min;
cout<<"\n Sc : "<<crit.arts_min;
break;
case 5:
if (ch==2)
read_eligible_com();
53 | P a g e
if (ch==3)
read_eligible_arts();
break;
case 6:
clrscr() ;
read_student();
break;
case 7:
{
char c;
int k=1;
cout<<"\n****************************************";
cout<<"\n****************************************";
cout<<"\n M E R I T L I S T";
cout<<"\n ==================";
cout<<"\n\tEnter 1 for MERIT LIST SCIENCE ";
cout<<"\n\tEnter 2 for MERIT LIST COMMERCE ";
cout<<"\n\tEnter 3 for MERIT LIST ARTS \t";
cout<<"\n****************************************";
cout<<"\n****************************************";
cin>>k;
if (k==1)
{
select_list("elig_sc","sell_sc");
fin.open("sell_sc",ios::in);
}
if (k==2)
54 | P a g e
{
select_list("eligcom","sellcom");
fin.open("sellcom",ios::in);
}
if (k==3)
{
select_list("eligart","sellart");
fin.open("sellart",ios::in);
}
{
while(fin.read((char*)& s,sizeof(s)))
{
s.display();
if(c=='n')
break;
}
fin.close();
fin.close();
fin.close();
break;
55 | P a g e
case 8:
thanks();
// cout<<"\nTHANKS BYE "; //
exit(0);
break;
}
// END OF WHILE
void assign_user()
{
strcpy(admin.user_name, "rimi");
strcpy(admin.password, "rimi");
}
int verify_password()
{
char u_name[10];
char u_pwd[10],temp[2];
int x=1;
cout<<"\n\n Enter user name : ";
cin>>u_name;
cout<<"\n\n Enter Password : ";
cin>>u_pwd;
x=strcmp(admin.user_name,u_name);
if (x==0)
{
x=strcmp(admin.password,u_pwd);
}
cin.getline(temp,2);
return(x);
56 | P a g e
}
void student::allot_stream()
{
int per=(m_eng+m_math+m_sc+m_sst+m_lang)/5;
read_criteria();
switch(pref_code)
{
case 1:
if(per>=crit.sc_min)
stream=pref_code;
else
stream=0;
break;
case 2:
if(per>=crit.com_min)
stream=pref_code;
else
stream=0;
break;
case 3:
if(per>=crit.arts_min)
stream=pref_code;
else
stream=0;
break;
}
}
int student::get_stream()
{
return(stream);
}
void input_criteria()
{
fstream fout;
fout.open("criteria" ,ios::in|ios::out);
57 | P a g e
cout<<"\nEnter the required marks for SCIENCE stream
(in percentage)";
cin>>crit.sc_min;
cout<<"\nEnter No. of Seats for SCIENCE stream";
cin>>crit.seat_sc;
cout<<"\nEnter the required marks for COMMERCE stream
(in percentage)";
cin>>crit.com_min;
cout<<"\nEnter No. of Seats for COMMERCE stream";
cin>>crit.seat_com;
cout<<"\nEnter the required marks for ARTS stream
(in percentage)";
cin>>crit.arts_min;
cout<<"\nEnter No. of Seats for ARTS stream";
cin>>crit.seat_arts;
fout.write((char*)& crit,sizeof(crit));
fout.close();
}
void read_criteria()
{
fstream fin;
fin.open("criteria" ,ios::in);
fin.read((char*)& crit,sizeof(crit));
fin.close();
void student::input_data()
{ clrscr();
fstream fin;
fin.open("student",ios::app|ios::out);
char t[2], ans;
while(1)
{
cout<<"\nEnter the name of the student : ";
gets(name);
cout<<"\n\nEnter the roll of the student : ";
cin>>regno;
cout<<"\n\nEnter marks in eng : ";
58 | P a g e
cin>>m_eng;
cout<<"\n\nEnter marks in math : ";
cin>>m_math;
cout<<"\n\nEnter marks in science : ";
cin>>m_sc;
cout<<"\n\nEnter marks in sst : ";
cin>>m_sst;
cout<<"\n\nEnter marks in language : ";
cin>>m_lang;
cout<<"==================STREAM PREFERED?================
\n";
cout<<"\t"<<"[1] for SCIENCE\n";
cout<<"\t"<<"[2] for COMMERCE\n";
cout<<"\t"<<"[3] for ARTS ";
cout<<"\n=================================================
\n\tENTER PREFERENCE CODE : ";
cin>>pref_code;
stream=-1;
fin.write((char*)&s,sizeof(s));
cin.getline(t,2);
cout<<"\n\tEnter More Student ? (y/n)";
cin>>ans;
if (ans=='n')
break;
}
fin.close();
}
void student::new_file()
{ clrscr();
fstream fin;
fin.open("student",ios::out);
char t[2], ans;
while(1)
{
cout<<"\nEnter the name of the student : ";
gets(name);
cout<<"\n\nEnter the roll of the student : ";
cin>>regno;
cout<<"\n\nEnter marks in eng : ";
cin>>m_eng;
59 | P a g e
cout<<"\n\nEnter marks in math : ";
cin>>m_math;
cout<<"\n\nEnter marks in science : ";
cin>>m_sc;
cout<<"\n\nEnter marks in sst : ";
cin>>m_sst;
cout<<"\n\nEnter marks in language : ";
cin>>m_lang;
cout<<"==================STREAM PREFERED?=== =============
\n";
cout<<"\t"<<"[1] for SCIENCE\n";
cout<<"\t"<<"[2] for COMMERCE\n";
cout<<"\t"<<"[3] for ARTS ";
cout<<"\n=================================================
\n\tENTER PREFERENCE CODE : ";
cin>>pref_code;
stream=-1;
fin.write((char*)&s,sizeof(s));
cin.getline(t,2);
cout<<"\n\tEnter More Student ? (y/n)";
cin>>ans;
if (ans=='n')
break;
}
fin.close();
}
void student::display()
{
cout<<"\n============================================\n";
cout<<"\n\tNAME : "<<name;
cout<<"\n\tREGISTRATION NO. : "<<regno;
cout<<"\n\tPERCENTAGE OF MARKS : "<<(
(m_eng+m_math+m_sc+m_sst+m_lang)/5)<<"%";
cout<<"\n\tSTREAM APPLIED FOR : "<<stream_name(pref_code);
// cout<<"\n\tSTREAM ALLOTED : "<<stream_name(stream);
cout<<"\n============================================\n";
60 | P a g e
void read_student()
{
fstream fin;
char c;
fin.open("student" ,ios::in);
while(fin.read((char*)& s,sizeof(s)))
{
s.display();
cout<<"\n\tPress any no. to continue ";
cin>>c;
cout<<"\n";
}
fin.close();
void read_eligible_sc()
{
char ans;
fstream fout;
fout.open("elig_sc",ios::in);
fout.seekg(0);
while(fout.read((char*)& s,sizeof(s)))
{
s.display();
cout<<"\n\t Continue (y/n)? ";
cin>>ans;
if (ans=='n')
break;
}
fout.close();
61 | P a g e
}
void read_eligible_com()
{
char ans;
fstream fout;
fout.open("eligcom",ios::in);
while(fout.read((char*)& s,sizeof(s)))
{
s.display();
cout<<"\n\t Continue (y/n)? ";
cin>>ans;
if (ans=='n')
break;
}
fout.close();
}
void read_eligible_arts()
{
char ans;
fstream fout;
fout.open("eligart",ios::in);
while(fout.read((char*)& s,sizeof(s)))
{
s.display();
cout<<"\n\t Continue (y/n)? ";
cin>>ans;
if (ans=='n')
break;
62 | P a g e
}
fout.close();
}
void clear()
{
// for(int i=1;i< =24;i++)
// cout<<"\n";
}
char * stream_name(int strm)
{
switch(strm)
{
case -1:
return("Not assigned");
// break;
case 0:
return("Nill");
// break;
case 1:
return("Science");
// break;
case 2:
return("Commerce");
// break;
case 3:
return("Arts");
// break;
default:
return("None");
}
}
void select_list( char *in_file, char *out_file)
{
fstream sel, fin;
int n=0, i,j;
student sl[100], t;
sel.open(out_file, ios::out);
fin.open(in_file,ios::in);
63 | P a g e
while(fin.read((char*)& sl[n],sizeof(s)))
{
n++;
}
cout<<"\nNo of Eligible Students = "<<n<<"\n";
for(i=0;i<n;i++)
{
for(j=i+1;j<=n;j++)
{
if ( sl[i].show_per()<sl[j].show_per())
{
t=sl[j];
sl[j]=sl[i];
sl[i]=t;
}
}
}
for(i=0;i<n;i++)
{
sel.write((char*)& sl[i],sizeof(s));
}
sel.close();
fin.close();
}
void welcome()
{
clrscr();
int z;
cout<<"\t%% %% ";
cout<<"\n\t%% %% %%%%%%% %% %%%%%% %%%%%% %%%%
%%%% %%%%%%%";
cout<<"\n\t%% %% %% %% %% %% %% %% %%% %% %%
";
cout<<"\n\t%% %% %% %%%%% %% %% %% %% %% %%% %%
%%%%% ";
64 | P a g e
cout<<"\n\t%% %% %% %% %% %% %% %% %% %% %%
";
cout<<"\n\t%%%%%%%%%% %%%%%%% %%%%%%% %%%%%%%
%%%%%% %% %% %%%%%%% ";
cout<<"\n\n\t\t\t $$$$$$$$ $$$$$ ";
cout<<"\n\t\t\t $$ $ $ ";
cout<<"\n\t\t\t $$ $$$$$ ";
// getch();
}
void thanks()
{ int w;
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\t********** T H A N K Y O U
F O R W O R K I N G *******";
cout<<"\n\n\n\n\n\n\n\t\t\tpress any number and then
'ENTER' to exit";
cin>>w;
}
65 | P a g e