Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
School Management (c++)
1. KENDRIYA VIDYALAYA NO -1, MADURAI -2
COMPUTER INVESTIGATORY PROJECT
SCHOOL MANAGEMENT
Guided by: SHRI.AMAN GUPTA, PGT(COMP)
Done by: C.Ram Mukilan XII A1,
S.P.Sri Nirdheeshwar XII A1,
K.G.Gautam XII A1.
2. SCHOOL MANAGEMENT
PROJECT REPORT
In Partial fulfillment of the requirements
For the award of the Class of
COMPUTER
Submitted By
C.Ram Mukilan XII A1,
S.P.Sri Nirdheeshwar XII A1,
K.G.Gautam XII A1.
UNDER THE GUIDANCE OF
SHRI.AMAN GUPTA, PGT(COMP)
CBSE AISSCE 2013 – 2014
KENDRIYA VIDYALAYA NO -1
NARIMEDU, MADURAI – 2
3. TABLE OF CONTENTS
SL.NO. TOPIC
1 Bona fide Certificate
2 Declaration
3 Acknowledgement
4 Introduction to c++
5 Introduction to Project
6 Codings
7 Outputs
8 Bibliography
4. BONA FIDE CERTIFICATE
This is to certify that the project entitled “SCHOOL
MANAGEMENT” is a record of Bona fide work carried out by
“C.Ram Mukilan XII A1, S.P.Sri Nirdheeshwar XII A1,
K.G.Gautam XII A1“. In partial fulfilment of the requirements in
COMPUTER prescribed by CBSE for AISSCE 2013-2014 in the school
Kendriya Vidyalaya Narimedu , Madurai-625002
DATE PRINCIPAL
INTERNAL EXAMINER EXTERNAL EXAMINER
5. DECLARATION
We hereby declare that the project work entitled
“SCHOOL MANAGEMENT“.
Submitted to KENDRIYA VIDYALAYA (NO.1),MADURAI for the
Subject of “COMPUTER“.
Under the guidance of SHRI.AMAN GUPTA, PGT(COMP), Is a
record of original work done by us.
We further Declare that this project record or any part of this has not
been Submitted elsewhere for any other class.
DATE (MEMBERS)
PLACE :
6. ACKNOWLEDGEMENT
We wish to express our sincere thanks to Mr. C. MUTHIAH Principal,
Kendriya Vidyalaya (no .1) Narimedu, Madurai for guiding us to cause
the successful outcome of this project work
We wish to express our deep & profound sense of gratitude to our guide
teacher SHRI. AMAN GUPTA, PGT(COMP), For his expert help &
valuable guidance, comments and suggestions
We wish to express our deep & profound sense of gratitude to our guide
teacher SHMT.SMITHA PRIYA, for her expert help & valuable
guidance, comments and suggestions
We also place on record, our sincere Gratitude to one and all who ,
Directly or Indirectly ,Have Lent their helping hand in this venture
7. INTRODUCTION TO C++
C++ is a programming Language Developed by Bjarne Stroustrup. It
was originally named as C with classes, was renamed as C++ in 1983.It is
regarded as an intermediate-level language, as it comprises both high-level
and low-level language features. Its application domains include systems
software, application software, device drivers, embedded software, high-
performance server and client applications, and entertainment software
such as video games. C++ continues to be used and is one of the preferred
programming languages to develop professional applications
The Features of C++ as a Language
Now that all the necessary theory has been covered, now it is possible to
explain what C++ has to offer as a programming language. C++....
• ...is an open source ISO-standardized language.
For a time, C++ had no official standard and was maintained by a de-
facto standard, however since 1998, C++ is standardized by a committee of
the ISO.
• ...is a compiled language.
C++ compiles directly to a machine's native code, allowing it to be one
of the fastest languages in the world, if optimized.
• ...supports both static and dynamic type checking.
C++ allows type conversions to be checked either at compile-time or
at run-time, again offering another degree of flexibility. Most C++ type
checking is, however, static.
• ...is portable.
8. As one of the most frequently used languages in the world and as an open
language, C++ has a wide range of compilers that run on many different
platforms that support it.Code that exclusively uses C++'s standard library
will run on many platforms with few to no changes.
9. INTRODUCTION TO PROJECT
Every School needs to maintain Data bases of the students, teachers and
staff etc., The data base on the students is required for general purpose
like collection fees, in Library for the issue of books and obtain back the
same and in the Laboratory, regarding issue of apparatus and damage
caused if any.
School management is a Software developed by a team of students viz
S.P.Sri Nirdheeshwar, C. Ram Mukilan, K.G. Gautham of XII A I of
KVS-1, Madurai as part of the curriculum of XII standard CBSE .
Using this Software, under the Office module, the database on the
students and teaches & staff can be created, modified. The same can be
used to verify whether any student is due for payment of term fees etc.
This can be used in the Library, Laboratory modules.
In the Library module of the software, a database on the available books
with author number, no of books, cost of book etc., can be created,
modified from time to time. By linking with the students database, the
issue of books can be entered against the name of the students. If the book
is returned, the same can be entered in the software. Hence at any point of
time, it is possible to get the details of the books taken by any student can
be obtained. We can check the availability of any book in the Library at
any point of time. Similarly, we can extent the software in future to get the
10. list of students having any particular book at any point of time.
In the Laboratory module, four labs are included viz Physics, Chemistry,
Biology, Computer Science. The list of equipment available and their cost
is included under each laboratory. The software can be extended to enter
the name and quantity of apparatus damaged by any student against
him/her and cost to be recovered from him/her can be assessed and
collected. Till it is paid, it will be shown as outstanding against that
student.
This software is useful to maintain updated and error free status of all the
students/teachers, collect/credit the fees/salary. And to Verify whether the
student has returned all the books and paid all the dues.
The Motive of this software is to dilute the work of office staffs, and to
reduce the use of paper.
12. char auth [50] ;
char publ [50] ;
int price ;
int copies ;
}book;
struct mdata
{
int mcode ;
char mname [20] ;
int std ;
char contact[15];
}member;
struct issdet
{
int mcode ;
char mname [20] ;
int mbcode ;
udat issue ;
udat retdat ;
}idet;
struct Chemical
{
int Sno ;
int Nos ;
int Vol ;
int Conc ;
char Name [30] ;
13. char DOE [30] ;
}chem;
struct system
{
int no ;
int mry ;
int ram ;
char prcs [30] ;
char os [30] ;
char cmpy [30] ;
long cost ;
}pc;
struct Instruments
{
int Sno ;
int numb_inst ;
int cost ;
char type [30] ;
char name_inst[30] ;
char company [30] ;
}Inst;
struct Specimen
{
int cost ;
int number ;
14. int Sno ;
char cname [50] ;
char type [30] ;
char sname [50] ;
char DOE [20] ;
}spec;
struct member
{
int pcode ;
char pname [40] ;
long fine ;
}pm;
/*--------------------------------
function prototypes
---------------------------------*/
void welcome ();
void interface ();
void password ();
void library ();
void labs ();
/*-----------------------------
basic info for student
-----------------------------*/
class basic
{
public :
15. char name[80];
char dob[15];
char father_name[80];
char mother_name[80];
char address[80];
char contact[15];
char religion[20];
char nationalty[20];
char language[50];
char current_stat[10];
int pday,pmonth,pyear; // date on when fee was paid..
void getvalues1();
};
/*------------------------------
adv info for student
--------------------------------*/
class advstu : public basic
{
public :
int admin_no;
int std;
char fee_stat[20];
void getvalues2();
}s1;
16. /*-------------------------------------
bassic info for teacher
-----------------------------------------*/
class advteach : public basic
{
public :
int staff_no;
char salary_stat[30];
void getvalues3();
}t1;
/*--------------------------
class menu for library
--------------------------*/
class libmenu
{
public:
int day, mon, year ;
void duedate (int,int,int) ;
void updatecopies (int,int) ;
void mainmenu ();
void issue ();
void returnbook();
void memopt ();
void mdetails ();
void memlist ();
void issuedet ();
void bookopt ();
18. void pay_fee(int);
void credict_salary(int);
void salary_check();
void salary();
void display_all_teachers();
void menu_student();
void menu_teacher();
void menu_main();
}ff;
/*----------------------------
date for officee
------------------------------*/
time_t theTime = time(NULL);
struct tm *aTime = localtime(&theTime);
int day = aTime->tm_mday;
int month = aTime->tm_mon + 1; // Month is 0 - 11, add 1 to get a jan-dec
1-12 concept
int year = aTime->tm_year + 1900; // Year is # years since 1900
/*-----------------------------
FEE for student
-------------------------------*/
class feedate
{ public:
int day,month,year ;
}f;
19. /*------------------------
Lab Files
---------------------------*/
void phylab();
void chemlab();
void complab();
void biolab();
/*-------------------------------
CLASS FOR LABORATORY
-----------------------------------*/
class Working
{
public:
void broken() ;
int sizeof_chem() ;
void Add_Chemical() ;
void Available_chemicals() ;
void Show_chemical_detail() ;
void Modify_Chemical() ;
int sizeof_system() ;
void Add_system() ;
void System_present() ;
void Show_system_detail() ;
void Modify_system() ;
int sizeof_inst(int) ;
void Add_inst(int) ;
void Show_inst(int) ;
20. int sizeof_spec() ;
void Add_spec() ;
void Available_specimen() ;
void Show_spec_details() ;
void Modify_specimen() ;
}W;
/*--------------------------------
function for welcome screen
--------------------------------*/
void welcome()
{
clrscr();
cout<<"n";
cout<<"tt ******************************************n";
cout<<"tt ** S C H O O L M A N A G E M E N T **n";
cout<<"tt ******************************************n";
gotoxy(3,24);
cout<<"Authors: C RAM MUKILAN, S P SRINIRDHESHWAR, K G
GAUTAM";
gotoxy(23,6);
cout<<"WELCOME TO HOGWARTS INTERNATIONALE";
gotoxy(16,10);
cout<<"THIS GUIDES TO INFORMATION ACCESS REGARDING
";
gotoxy(16,12);
cout<<"ADMINISTRATION,LIBRARY AND LABORATORY
MANGEMENT";
gotoxy(20,14);
cout<<"THIS CAN ACCESED ONLY BY ADMINISTRATORS";
23. {
case 1 :
ff.menu_main();
break;
case 2 :
library();
break;
case 3 :
labs();
break;
case 0 :
welcome();
break;
default:
gotoxy(30,19);
cout<<"WRONG CHOICE";
}
}
/*------------------------------------
office main menu
-------------------------------------*/
void office_function:: menu_main()
{
int ch;
clrscr();
while(1)
24. {
clrscr();
cout<<"nnn";
cout<<"tt WELCOME TO HOGWART'S SCHOOL OF
EXCELLENCE n";
cout<<"tt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~nn";
cout<<"tt ADMINISTRATION WING n";
cout<<"tt ~~~~~~~~~~~~~~~~~~~~~ ";
gotoxy(33,12);
cout<<"1. STUDENT INFO";
gotoxy(33,14);
cout<<"2.TEACHER INFO";
gotoxy(33,16);
cout<<"0. EXIT";
gotoxy(30,20);
cout<<"Enter the choice : ";
cin>>ch;
clrscr();
switch(ch)
{
case 1:
menu_student();
break;
case 2:
menu_teacher();
break;
case 0:
interface();
25. }
getch();
}
}
/*------------------------------------
size of student
--------------------------------------*/
int office_function :: size_student()
{
int no;
int pos;
int size;
fstream out;
out.open("DATA.dat",ios::in|ios::out);
out.seekg(0,ios::end);
pos=out.tellp();
size=sizeof(s1);
no=pos/size;
no++;
out.close();
return no;
}
/*---------------------------------
student menu
-----------------------------------*/
void office_function:: menu_student()
26. {
int ch;
while(1)
{
clrscr();
cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"1. ENROLL A STUDENT";
gotoxy(30,10);
cout<<"2. DISPLAY A STUDENT ";
gotoxy(30,12);
cout<<"3. MODIFY ";
gotoxy(30,14);
cout<<"4. FEE DETAILS ";
gotoxy(30,16);
cout<<"0. EXIT";
gotoxy(25,20);
cout<<"ENTER YOUR CHOICE : ";
//textbackground(WHITE);
//textcolor(CYAN+BLINK);
cin>>ch;
switch(ch)
{
case 1:
s1.getvalues2();
break;
case 2:
27. display_student();
break;
case 3:
modify_student();
break;
case 4:
fee();
break;
case 0:
menu_main();
}
getch();
}
}
/*----------------------------------
get student data
-----------------------------------*/
void basic:: getvalues1()
{
clrscr();
pday=0;
pmonth=0;
pyear=0;
cout<<"ntt E N T E R I N F O R M A T I O N ";
cout<<"ntt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(10,24);
cout<<"PLEASE ENTER THE DETAILS ONLY IN
CAPTIAL LETTERS";
32. {
int ch1;
clrscr();
cout<<"nnn";
cout<<"ttt S T U D E N T D I S P L A Y n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"1.BASIC INFORMATION ";
gotoxy(30,10);
cout<<"2.ADVANCE INFORMATION ";
gotoxy(30,12);
cout<<"3.DISPLAY ALL";
gotoxy(30,14);
cout<<"0.EXIT";
gotoxy(25,18);
cout<<"Enter the choice : ";
cin>>ch1;
clrscr();
switch(ch1)
{
case 1:
display_basic_student();
break;
case 2:
display_adv_student();
break;
case 3:
display_all_students();
break;
33. case 0:
welcome();
}
}
/*----------------------------------------
display student
--------------------------------------------*/
void office_function :: display_basic_student()
{ clrscr();
int rn;
cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"ENTER THE ADMIN NO : ";
cin>>rn;
clrscr();
cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
ifstream in;
in.open("data.dat");
in.seekg(0);
while(!in.eof())
{
in.read((char*)&s1,sizeof(s1));
if(s1.admin_no==rn)
34. { gotoxy(30,8);
cout<<"Admin no : "<<s1.admin_no;
gotoxy(30,10);
cout<<"Name : "<<s1.name;
gotoxy(30,12);
cout<<"Date of birth : "<<s1.dob;
break;
}
}
if(getche())
{
display_student();
}
}
/*----------------------------------------
display student
--------------------------------------------*/
void office_function:: display_adv_student()
{
int rn;
cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"ENTER THE ADMIN NO : ";
cin>>rn;
clrscr();
35. cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
ifstream in;
in.open("data.dat");
in.seekg(0);
while(!in.eof())
{
in.read((char*)&s1,sizeof(s1));
if(s1.admin_no==rn)
{
gotoxy(30,8);
cout<<"ADMIN NO : "<<s1.admin_no;
gotoxy(30,9);
cout<<"NAME : "<<s1.name;
gotoxy(30,10);
cout<<"DATE OF BIRTH : "<<s1.dob;
gotoxy(30,11);
cout<<"FATHER NAME : "<<s1.father_name;
gotoxy(30,12);
cout<<"MOTHER NAME : "<<s1.mother_name;
gotoxy(30,13);
cout<<"ADDRESS : "<<s1.address;
gotoxy(30,14);
cout<<"CONTACT : "<<s1.contact;
gotoxy(30,15);
cout<<"NATIONALITY : "<<s1.nationalty;
gotoxy(30,16);
36. cout<<"LANGUAGE : "<<s1.language;
gotoxy(30,17);
cout<<"FEE STATUS : "<<s1.fee_stat;
gotoxy(30,18);
cout<<"FEE PAID ON : "<<s1.pday<<" "<<s1.pmonth<<"
"<<s1.pyear;
break;
}
getch();
}
if(getche())
{
display_student();
}
}
/*----------------------------------------
display all student
--------------------------------------------*/
void office_function:: display_all_students()
{
int x=8;
clrscr();
cout<<"nnn";
cout<<"ttt S T U D E N T I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
cout<<"n---------------------------------------------------------------------
----------";
38. }
file.close();
getch();
}
/*-----------------------------------------
modify student
------------------------------------------*/
void office_function:: modify_student()
{ char
newname[80],newfather[80],newmother[80],newaddress[120],newdob[12],n
ewcontact[10];
clrscr();
cout<<"nnn";
cout<<"ttt M O D I F Y S T U D E N T n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
fstream fio("DATA.dat",ios::in|ios::out|ios::binary);
int rn;
cout<<"tENTER THE ADMIN NO : ";
cin>>rn;
gotoxy(20,24);
cout<<" < . > to retain the values ";
while(!fio.eof())
{ fio.read((char*)&s1,sizeof(s1));
if(s1.admin_no==rn)
{
gotoxy(10,8);
cout<<"ADMIN NO : "<<s1.admin_no;
gotoxy(10,9);
cout<<"NAME : "<<s1.name;
42. gotoxy(30,12);
cout<<"3. MODIFY ";
gotoxy(30,14);
cout<<"4. SALARY STATUS";
gotoxy(30,16);
cout<<"0. EXIT";
gotoxy(25,20);
cout<<"ENTER YOUR CHOICE : ";
cin>>ch;
switch(ch)
{
case 1:
t1.getvalues3();
break;
case 2:
display_teacher();
break;
case 3:
modify_teacher();
break;
case 4:
salary();
break;
case 0:
menu_main();
}
getch();
}
}
43. /*----------------------------------------
size of techer
--------------------------------------------*/
int office_function::size_teacher()
{
int no;
int pos;
int size;
fstream out;
out.open("DATA1.dat",ios::in|ios::out);
out.seekg(0,ios::end);
pos=out.tellp();
size=sizeof(t1);
no=pos/size;
no++;
out.close();
return no;
}
/*----------------------------------------
get info techer
--------------------------------------------*/
void advteach::getvalues3()
{
getvalues1();
gotoxy(25,15);
cout<<"Salary Details : ";
44. gotoxy(25,17);
cout<<"(CREDICTED/NOT CREDICTED) ";
gotoxy(41,15);
gets(salary_stat);
ff.add_teacher();
}
/*----------------------------------------
add teacher
--------------------------------------------*/
void office_function:: add_teacher()
{ char ch;
clrscr();
cout<<"nn";
cout<<"ttt A D M I S S I O N n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(20,10);
cout<<"DO YOU WANT TO SAVE THIS RECORD (Y/N) : ";
cin>>ch;;
if(ch=='y'||ch=='Y')
{
gotoxy(20,12);
cout<<"PLEASE NOTE DOWN YOUR STAFF NO ...";
t1.staff_no=size_teacher();
cout<<"nntttt"<<t1.staff_no;
ofstream out;
out.open("data1.dat",ios::app);
out.write((char*)&t1,sizeof(t1));
46. cin>>ch1;
clrscr();
switch(ch1)
{
case 1:
display_basic_teacher();
break;
case 2:
display_adv_teacher();
break;
case 3:
display_all_teachers();
case 0:
welcome();
}
}
/*----------------------------------------
display teacher
--------------------------------------------*/
void office_function:: display_basic_teacher()
{ clrscr();
int rn;
cout<<"nnn";
cout<<"ttt T E A C H E R I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"Enter the STAFF NO to be searched : ";
cin>>rn;
47. clrscr();
cout<<"nnn";
cout<<"ttt T E A C H E R I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
ifstream in;
in.open("data1.dat");
in.seekg(0);
while(!in.eof())
{
in.read((char*)&t1,sizeof(t1));
if(t1.staff_no==rn)
{ gotoxy(30,8);
cout<<"STAFF NO : "<<t1.staff_no;
gotoxy(30,9);
cout<<"NAME : "<<t1.name;
gotoxy(30,10);
cout<<"DATE OF BIRTH : "<<t1.dob;
break;
}
getch();
};
}
/*----------------------------------------
display of techer
--------------------------------------------*/
void office_function:: display_adv_teacher()
{ int rn;
cout<<"nnn";
48. cout<<"ttt T E A C H E R I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,8);
cout<<"Enter the admin no to be searched : ";
cin>>rn;
clrscr();
cout<<"nnn";
cout<<"ttt T E A C H E R I N F O n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~n";
ifstream in;
in.open("data1.dat");
in.seekg(0);
while(!in.eof())
{
in.read((char*)&t1,sizeof(t1));
if(t1.staff_no==rn)
{
gotoxy(30,8);
cout<<"STAFF NO : "<<t1.staff_no;
gotoxy(30,9);
cout<<"NAME : "<<t1.name;
gotoxy(30,10);
cout<<"DATE OF BIRTH : "<<t1.dob;
gotoxy(30,11);
cout<<"FATHER NAME : "<<t1.father_name;
gotoxy(30,12);
cout<<"MOTHER NAME : "<<t1.mother_name;
gotoxy(30,13);
cout<<"ADDRESS : "<<t1.address;
49. gotoxy(30,14);
cout<<"CONTACT : "<<t1.contact;
gotoxy(30,15);
cout<<"NATIONALITY : "<<t1.nationalty;
gotoxy(30,16);
cout<<"LANGUAGE : "<<t1.language;
gotoxy(30,17);
cout<<"SALARY STATUS :"<<t1.salary_stat;
gotoxy(30,18);
cout<<"SALARY ";
gotoxy(30,19);
cout<<"CREDICTED ON ";
gotoxy(46,19);
cout<<t1.pday<<" "<<t1.pmonth<<" "<<t1.pyear;
break;
}
getch();
};
}
/*----------------------------------------
display all teacher
--------------------------------------------*/
void office_function:: display_all_teachers()
{
int x= 10;
clrscr();
cout<<"nnn";
cout<<"ttt T E A C H E R I N F O n";
66. /*---------------------------------
Library Intro
-------------------------------*/
void library()
{
clrscr();
cout<<"nnn";
cout<<"tt WELCOME TO HOGWART'S BIBLIOTHEQUE
n";
cout<<"tt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(13,9);
cout <<" HOGWARTS BIBLIOTHEQUE (HB) HAS A WIDE
ARRAY OF";
gotoxy(13,11);
cout<<" NOVELS ,REFERENCES AND OTHER
KNOWLEDGE SOURCES";
gotoxy(13,13);
cout<<" HB IS WELL EQUIPPED LIBRARY WITH E-BOOK
SERVICES";
gotoxy(13,15);
cout<<"THIS APPLICATION WILL GUIDE YOU TO THE
LIBRARIAN'S DESK.";
gotoxy(27,21);
cout<<"PRESS TO CONTINUE....." ;
if(getche())
{
libr.mainmenu();
}
67. }
/*-----------------------------------
function to show menu for library
----------------------------------*/
void libmenu::mainmenu()
{
int lmch;
clrscr();
cout<<"nn";
cout<<"ttt L I B R A R Y n";
cout<<"ttt ~~~~~~~~~~~~~~~n";
gotoxy(5,24);
cout<<" LIBRARIAN: VISHNU PRASADtttt < 0 > for EXIT ";
gotoxy(30,7);
cout<<"1. INTRODUCTION";
gotoxy(30,9);
cout<<"2. ISSUE BOOK" ;
gotoxy(30,11);
cout<<"3. RETURN BOOK";
gotoxy(30,13);
cout<<"4. MEMBERS ";
gotoxy(30,15);
cout<<"5. BOOKS ";
gotoxy(24,19);
68. cout<<"ENTER THE CHOICE: ";
cin>>lmch;
switch (lmch)
{
case 1 :
library();
break;
case 2 :
issue();
break;
case 3 :
returnbook();
break;
case 4 :
memopt();
break;
case 5 :
bookopt();
break;
case 0 :
interface();
break;
default:
gotoxy(30,21);
cout<<"WRONG CHOICE";
if(getche())
{
mainmenu();
}
69. }
}
/*--------------------------
duedate calculator
--------------------------*/
void libmenu ::duedate(int d1, int m1, int y1)
{
static int month[] = {31,29,31,30,31,30,31,31,30,31,30,31} ;
for (int i=1; i<=15; i++)
{
d1++ ;
if ((d1 > month[m1-1]) || (y1%4 != 0 && m1 == 2 && d1 > 28))
{
d1 = 1 ;
m1++ ;
}
if (m1 > 12)
{
m1 = 1 ;
y1++ ;
}
}
day = d1 ;
mon = m1 ;
year = y1 ;
}
70. void libmenu::issue()
{
int tbcode,tmcode;
char tmname[20];
date d;
getdate(&d);
int day = d.da_day ;
int mon = d.da_mon ;
int year= d.da_year ;
clrscr();
cout<<"Date: "<<day<<"/"<<mon<<"/"<<year;
cout<<"nn";
cout<<"ttt I S S U E B O O K n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~n";
gotoxy(5,8) ;
cout <<"Enter Code of the Book to be issued : " ;
cin>>tbcode;
blist.open("booklist.dat",ios::in);
while(!blist.eof())
{
blist.read((char*)&book,sizeof(book));
if(book.bcode==tbcode)
{
cout<<"nt"<<book.bcode;
cout<<"tt"<<book.bname;
cout<<"tt"<<book.auth;
break;
}
71. }
blist.close();
gotoxy(5,12);
cout <<"Enter Code of the Member to be issued : " ;
cin>>tmcode;
mlist.open("memlist.dat",ios::in);
while(!mlist.eof())
{
mlist.read((char*)&member,sizeof(member));
if(member.mcode==tmcode)
{
{
cout<<"nt"<<member.mcode;
cout<<"tt"<<member.mname;
strcpy(tmname,member.mname);
}
}
}
mlist.close();
char wch ;
gotoxy(30,20);
cout<<"WANT TO ISSUE (y/n) : ";
cin>>wch;
if(wch=='y'||wch=='Y')
{
issfile.open("issdet.dat",ios::out|ios::in|ios::app);
idet.mcode=tmcode;
strcpy(idet.mname,tmname);
72. idet.mbcode=tbcode;
idet.issue.day = day ;
idet.issue.mon = mon ;
idet.issue.year = year ;
duedate(day,mon,year) ;
idet.retdat.day = libr.day ;
idet.retdat.mon = libr.mon ;
idet.retdat.year = libr.year ;
issfile.write((char*)&idet,sizeof(idet));
issfile.close();
mainmenu();
}
else
{
mainmenu();
}
}
/*------------------------------
function to return book
-------------------------------*/
void libmenu::returnbook()
{
long rpos ;
int rmcode;
date d;
getdate(&d);
int day = d.da_day ;
73. int mon = d.da_mon ;
int year= d.da_year ;
clrscr();
cout<<"Date: "<<day<<"/"<<mon<<"/"<<year;
cout<<"nn";
cout<<"ttt R E T U R N B O O K n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(5,8) ;
cout <<"Enter Code of the Member to be return : " ;
cin>>rmcode;
issfile.open("issdet.dat",ios::in|ios::out);
while(!issfile.eof())
{
rpos=issfile.tellg();
issfile.read((char*)&idet,sizeof(idet));
if(idet.mcode==rmcode)
{
gotoxy(20,10);
cout<<"MEMBER CODE : "<<idet.mcode;
gotoxy(20,11);
cout<<"MEMBER NAME : ";
puts(idet.mname);
gotoxy(20,12);
cout<<"BOOK CODE : "<<idet.mbcode;
gotoxy(20,13);
cout<<"ISSUE DATE :
"<<idet.issue.day<<"/"<<idet.issue.mon<<"/"<<idet.issue.year;
gotoxy(20,14);
75. {
int opt;
clrscr();
cout<<"nn";
cout<<"ttt M E M B E R S n";
cout<<"ttt ~~~~~~~~~~~~~~~~n";
gotoxy(60,24);
cout<<" < 0 > for EXIT ";
gotoxy(30,9);
cout<<"1. VIEW MEMBERS LIST" ;
gotoxy(30,11);
cout<<"2. MEMBERS DETAILS";
gotoxy(30,13);
cout<<"3. ISSUED DETAILS";
gotoxy(24,18);
cout<<"ENTER THE CHOICE: ";
cin>>opt;
switch (opt)
{
case 1 :
{
memlist();
break;
}
case 2 :
mdetails() ;
break;
case 3 :
76. issuedet();
break;
case 0 :
library();
break;
default:
gotoxy(30,21);
cout<<"WRONG CHOICE";
if(getche())
{
memopt();
}
}
}
/*------------------------------
function to show book option
-------------------------------*/
void libmenu::memlist()
{
clrscr();
gotoxy(28,3);
cout<<" L I S T O F M E M B E R S ";
gotoxy(28,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
cout<<"nnn-----------------------------------------------------------------
--------------";
cout<<"n C O D E N A M E C L A S S C O N T A C T
78. }
}
cout<<"nnnnttttPRESS ANY KEY ...";
mlist.close();
if(getche())
{
memopt();
}
}
/*------------------------------
function to show memberdetails
-------------------------------*/
void libmenu :: mdetails()
{
clrscr();
gotoxy(28,3);
cout<<" M E M B E R S D E T A I L S";
gotoxy(28,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
int mdetcode;
cout<<"nnnttENTER A MEMBER CODE: ";
cin>>mdetcode;
mlist.open("memlist.dat",ios::in) ;
while(!mlist.eof())
{
mlist.read((char*)&member,sizeof(member));
if(member.mcode==mdetcode)
80. clrscr();
gotoxy(28,3);
cout<<" I S S U E D E T A I L S";
gotoxy(28,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~";
int isscode,found=0;
cout<<"nnnttENTER A MEMBER CODE: ";
cin>>isscode;
gotoxy(12,18);
cout<<"If return date and Issue date are zero the record is last issued";
issfile.open("issdet.dat",ios::in);
while(!issfile.eof())
{
issfile.read((char*)&idet,sizeof(idet));
if(idet.mcode==isscode)
{
found=1;
gotoxy(26,10);
cout<<"MEMBER CODE : "<<idet.mcode;
gotoxy(26,12);
cout<<"MEMBER NAME : ";
puts(idet.mname);
gotoxy(26,14);
cout<<"BOOK : "<<idet.mbcode;
gotoxy(26,15);
cout<<"ISSUE DATE :
"<<idet.issue.day<<"/"<<idet.issue.mon<<"/"<<idet.issue.year ;
gotoxy(26,16);
cout<<"RETURN DATE :
86. void libmenu::booklist()
{
clrscr();
gotoxy(28,3);
cout<<" L I S T O F B O O K S ";
gotoxy(28,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~";
cout<<"nnn-----------------------------------------------------------------
--------------";
cout<<"n C O D E N A M E A U T H O R P U B L I S H E
R ";
cout<<"
--------------------------------------------------------------------------------
";
blist.open("booklist.dat",ios::in) ;
blist.seekg(0);
int r=10;
while(1)
{
blist.read((char*)&book,sizeof(book));
if(blist.eof())
{
break;
}
for(int i=0;i<100;i++)
{
if(book.bcode==i)
{
88. }
}
/*----------------------
function to show bookdetails
------------------------*/
void libmenu::bdetails()
{
clrscr();
gotoxy(28,3);
cout<<" B O O K S D E T A I L S";
gotoxy(28,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~";
int bdetcode;
cout<<"nnnttENTER A BOOK CODE: ";
cin>>bdetcode;
blist.open("booklist.dat",ios::in) ;
while(!blist.eof())
{
blist.read((char*)&book,sizeof(book));
if(book.bcode==bdetcode)
{
gotoxy(26,10);
cout<<"CODE : "<<book.bcode;
gotoxy(26,12);
cout<<"NAME : ";
puts(book.bname);
gotoxy(26,14);
90. }
/*------------------
Modify a book
--------------------*/
void libmenu::bmodify()
{
char newbname[30];
char newauth [30];
char newpubl [80];
int newcopies;
int newprice ;
clrscr();
blist.open("booklist.dat",ios::in|ios::out|ios::binary);
long curpos;
gotoxy(28,3);
cout<<"M O D I F Y B O O K S";
gotoxy(26,4);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~";
int modcode;
cout<<"nnnttENTER A BOOK CODE: ";
cin>>modcode;
while(!blist.eof())
{ curpos=blist.tellg();
blist.read((char*)&book,sizeof(book));
if(book.bcode == modcode)
{
gotoxy(12,10);
cout<<"CODE : "<<book.bcode;
gotoxy(12,12);
96. A B ~~~~~~~~";
while(1)
{
clrscr();
gotoxy(20,8);
cout<<"1. ADD A NEW CHEMICAL";
gotoxy(20,10);
cout<<"2. ADD A ACCESSORY";
gotoxy(20,12);
cout<<"3. SHOW AVAILABLE CHEMICAL";
gotoxy(20,14);
cout<<"4. CHEMICAL DETAILS ";
gotoxy(20,16);
cout<<"5. INSTRUMENTS DETAILS";
gotoxy(20,18);
cout<<"6. MODIFY";
gotoxy(20,20);
cout<<"0. BACK";
gotoxy(15,5);
cout<<"ENTER A CHOICE:- ";
cin>>ch;
switch(ch)
{
case 1:
W.Add_Chemical();
break;
case 2:
W. Add_inst(2);
98. /*---------------------------------------
COMPUTER LAB
---------------------------------------*/
void complab()
{
int ch,n;
cout<<"WELCOME TO COMPUTER LABORATORY";
while(1)
{
clrscr();
gotoxy(20,8);
cout<<"1. ADD A NEW SYSTEM";
gotoxy(20,10);
cout<<"2. ADD A ACCESSORY";
gotoxy(20,12);
cout<<"3. SHOW AVAILABLE SYSTEM";
gotoxy(20,14);
cout<<"4. SYSTEM DETAILS ";
gotoxy(20,16);
cout<<"5. INSTRUMENTS DETAILS";
gotoxy(20,18);
cout<<"6. MODIFY";
gotoxy(20,20);
cout<<"0. BACK";
gotoxy(15,5);
cout<<"ENTER A CHOISE:- ";
cin>>ch;
switch(ch)
{
99. case 1:
W. Add_system();
break;
case 2:
W. Add_inst(3);
break;
case 3:
W.System_present();
break;
case 4:
W.Show_system_detail();
break;
case 5:
W.Show_inst(3);
break;
case 6:
W.Modify_system();
break;
case 0:
labs();
default:
100. cout<<"ENTER A VALID CHOICE";
}
getch();
}
}
/*-------------------------------
BIOLOGY LAB
-----------------------------------*/
void biolab() //Bioloy Lab Menu
{
int n,ch;
cout<<" WELCOME TO BIOLOGY LABORATORY";
while(1)
{
clrscr();
gotoxy(20,8);
cout<<"1. ADD A NEW SPECIMEN";
gotoxy(20,10);
cout<<"2. ADD A INSTRUMENT";
gotoxy(20,12);
cout<<"3. SHOW AVAILABLE SPECIMEN";
gotoxy(20,14);
cout<<"4. SPECIMEN DETAILS ";
gotoxy(20,16);
cout<<"5. INSTRUMENTS DETAILS";
gotoxy(20,18);
cout<<"6. MODIFY";
gotoxy(20,20);
101. cout<<"0. BACK";
gotoxy(15,5);
cout<<"ENTER A CHOICE:- ";
cin>>ch;
switch(ch)
{
case 1:
W.Add_spec() ;
break;
case 2:
W. Add_inst(4);
break;
case 3:
W.Available_specimen();
break;
case 4:
W.Show_spec_details() ;
break;
case 5:
W.Show_inst(4);
break;
case 6:
W.Modify_specimen();
102. break;
case 0:
labs();
default:
cout<<"ENTER A VALID CHOICE";
}
getch();
}
}
/*-------------------------------
SIZEOF CHEMISTRYLAB
-----------------------------------*/
int Working ::sizeof_chem()
{
ifstream fin;
int no;
fin.open("Chemical.dat",ios::in);
fin.seekg(0,ios::end);
long pos=fin.tellg();
no=pos/sizeof(chem);
no++;
fin.close();
return no;
}
/*-------------------------------
103. ADD CHEMICALS
-----------------------------------*/
void Working::Add_Chemical()
{
clrscr();
ofstream fo;
fo.open("Chemical.dat",ios::out|ios::app);
cout<<"ntt A D D C H E M I C A L ";
cout<<"ntt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
while(1)
{
chem.Sno=sizeof_chem();
gotoxy(25,5);
cout<<"SERIAL NUMBER : ";
gotoxy(25,6);
cout<<"CHEMICAL NAME : ";
gotoxy(25,7);
cout<<"volume : ";
gotoxy(25,8);
cout<<"CONCENTRATION : ";
gotoxy(25,9);
cout<<"DATE OF EXPITY : ";
gotoxy(25,10);
cout<<"NUMBER OF ITEMS: ";
gotoxy(43,5);
cout<<chem.Sno;
gotoxy(43,6);
105. ----------";
cout<<" n S.NO N A M E C O N C. ";
cout<<"------------------------------------------------------------------------
----";
fin.open("Chemical.dat",ios::in);
fin.seekg(0);
int r=12;
while(1)
{
fin.read((char*)&chem,sizeof(chem));
if(fin.eof())
break;
gotoxy(5,r);
cout<<chem.Sno;
gotoxy(28,r);
cout<<chem.Name;
gotoxy(57,r);
cout<<chem.Conc;
r=r+2;
}
cout<<"nnnnttttPress any key ...";
fin.close();
}
/*-------------------------------
CHEMICALS DETAILS
-----------------------------------*/
106. void Working :: Show_chemical_detail()
{
clrscr();
int n;
cout<<"n";
cout<<"ttt C H E M I C A L D E T A I L n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>n;
ifstream fin;
fin.open("Chemical.dat",ios::in);
fin.seekg(0);
while(!fin.eof())
{
fin.read((char*)&pc,sizeof(pc));
if(chem.Sno==n)
{
gotoxy(30,8);
cout<<"SERIAL NO : "<<chem.Sno;
gotoxy(30,9);
cout<<"CHEMICAL NAME : "<<chem.Name;
gotoxy(30,10);
cout<<"CONCENTRATION : "<<chem.Conc;
gotoxy(30,11);
cout<<"VOLUME : "<<chem.Vol;
gotoxy(30,12);
cout<<"DATE OF EXPIRY : "<<chem.DOE;
gotoxy(30,13);
107. cout<<"NUMBER OF ITEMS : "<<chem.Nos;
cout<<"nnnnttttPRESS ANY KEY ...";
break;
}
}
fin.close();
}
/*-------------------------------
MODIFY CHEMICALS
-----------------------------------*/
void Working :: Modify_Chemical()
{
clrscr();
int newconc,newvol,newnos;
char newcname[30],newDOE[30];
fstream sys;
sys.open("Chemical.dat",ios::in|ios::out|ios::binary);
long curpos;
cout<<"n";
cout<<"ttt M O D I F Y C H E M I C A L n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
int modcode;
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>modcode;
while(!sys.eof())
{
108. curpos=sys.tellg();
sys.read((char*)&chem,sizeof(chem));
if(chem.Sno == modcode)
{
gotoxy(20,8);
cout<<"SERIAL NO : "<<chem.Sno;
gotoxy(20,9);
cout<<"CHEMICAL NAME : "<<chem.Name;
gotoxy(20,10);
cout<<"CONCENTRATION : "<<chem.Conc;
gotoxy(20,11);
cout<<"VOLUME ( IN LITRES) : "<<chem.Vol;
gotoxy(20,12);
cout<<"DATE OF EXPIRY : "<<chem.DOE;
gotoxy(20,13);
cout<<"NUMBER OF ITEMS : "<<chem.Nos;
gotoxy(15,20);
cout<<"ENTER '.' TO RETAIN THE VALUES OF CHARACTER";
gotoxy(15,21);
cout<<"RETYPE THE NUMBER TO RETAIN";
gotoxy(55,9);
gets(newcname);
gotoxy(55,10);
cin>>newconc;
gotoxy(55,11);
cin>>newvol ;
gotoxy(55,12);
gets(newDOE);
gotoxy(55,13);
110. no++;
fin.close();
return no;
}
void Working :: Add_system() //To add the values of New_system
{
clrscr();
int n;
char ch;
ofstream fo;
fo.open("system_pc.dat",ios::out|ios::app);
cout<<"ntt A D D S Y S E M ";
cout<<"ntt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
while(1)
{
pc.no=sizeof_system();
gotoxy(25,5);
cout<<"SERIAL NUMBER : ";
gotoxy(25,6);
cout<<"PROCESSOR : ";
gotoxy(25,7);
cout<<"OPERATING SYSTEM : ";
gotoxy(25,8);
cout<<"COMPANY : ";
gotoxy(25,9);
cout<<"HARD DISK(IN GB) : ";
gotoxy(25,10);
cout<<"R.A.M ( in GB) : ";
112. {
clrscr();
fstream fin;
gotoxy(28,4);
cout<<" S Y S T E M P R E S E N T ";
gotoxy(25,5);
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
cout<<"nnn-----------------------------------------------------------------
--------------";
cout<<"n S.NO C O M P A N Y O S ";
cout<<"------------------------------------------------------------------------
------";
fin.open("system_pc.dat",ios::in);
fin.seekg(0);
int r=12;
while(1)
{
fin.read((char*)&pc,sizeof(pc));
if(fin.eof())
break;
gotoxy(5,r);
cout<<pc.no;
gotoxy(28,r);
cout<<pc.cmpy;
gotoxy(57,r);
cout<<pc.os;
113. r=r+2;
}
cout<<"nnnnttttPRESS ANY KEY ...";
fin.close();
getch();
complab();
}
/*-------------------------------
SYSTEM DETAILS
-----------------------------------*/
void Working::Show_system_detail() //To display the value of New_system
{
clrscr();
int n;
cout<<"n";
cout<<"ttt C H E M I C A L D E T A I L n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>n;
ifstream fin;
fin.open("system_pc.dat",ios::in);
fin.seekg(0);
while(!fin.eof())
{
fin.read((char*)&pc,sizeof(pc));
if(pc.no==n)
114. {
gotoxy(30,8);
cout<<"SERIAL NO : "<<pc.no;
gotoxy(30,9);
cout<<"PROCESSOR : "<<pc.prcs;
gotoxy(30,10);
cout<<"OPERATING SYSTEM : "<<pc.os;
gotoxy(30,11);
cout<<"COMPANY : "<<pc.cmpy;
gotoxy(30,12);
cout<<"HARD DISK ( IN GB) : "<<pc.mry;
gotoxy(30,13);
cout<<"R.A.M in GB ) : "<<pc.ram;
gotoxy(30,14);
cout<<"COST ( in Rs ) : "<<pc.cost;
cout<<"nnnnttttPress any key ...";
break;
}
}
fin.close();
}
/*-------------------------------
MODIFY SYSTEM
-----------------------------------*/
void Working :: Modify_system()
{
clrscr();
int newmry,newram,newcost;
115. char newprcs[30],newos[30],newcmpy[30];
fstream sys;
sys.open("system_pc.dat",ios::in|ios::out|ios::binary);
long curpos;
cout<<"n";
cout<<"ttt M O D I F Y S Y S T E M n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
int modcode;
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>modcode;
while(!sys.eof())
{
curpos=sys.tellg();
sys.read((char*)&pc,sizeof(pc));
if(pc.no == modcode)
{
gotoxy(20,8);
cout<<"SERIAL NO : "<<pc.no;
gotoxy(20,9);
cout<<"PROCESSOR : "<<pc.prcs;
gotoxy(20,10);
cout<<"OPERATING SYSTEM : "<<pc.os;
gotoxy(20,11);
cout<<"COMPANY : "<<pc.cmpy;
gotoxy(20,12);
cout<<"HARD DISK ( IN GB) : "<<pc.mry;
gotoxy(20,13);
116. cout<<"R.A.M ( in GB ) : "<<pc.ram;
gotoxy(20,14);
cout<<"COST ( in Rs ) : "<<pc.cost;
gotoxy(15,20);
cout<<"ENTER '.' TO RETAIN THE VALUES OF CHARACTER";
gotoxy(15,21);
cout<<"RETYPE THE NUMBER TO RETAIN";
gotoxy(55,9);
gets(newprcs);
gotoxy(55,10);
gets(newos);
gotoxy(55,11);
gets(newcmpy);
gotoxy(55,12);
cin>>newmry;
gotoxy(55,13);
cin>>newram;
gotoxy(55,14);
cin>>newcost;
if(strcmp(newprcs,".")!=0)
strcpy(pc.prcs,newprcs);
if(strcmp(newos,".")!=0)
strcpy(pc.os,newos);
if(strcmp(newcmpy,".")!=0)
strcpy(pc.cmpy,newcmpy);
pc.mry=newmry;
pc.ram=newram;
pc.cost=newcost;
break ;
118. return no;
}
/*-------------------------------
ADD INSTRUMENTS
-----------------------------------*/
void Working :: Add_inst(int n) // To add new instruments/accessories
{
clrscr();
char ch;
ofstream fo;
cout<<"ntt A D D I N S T R U M E N T S ";
cout<<"ntt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
if(n==1)
fo.open("phy_inst.dat",ios::out|ios::app);
if(n==2)
fo.open("chem_inst.dat",ios::out|ios::app);
if(n==3)
fo.open("comp_inst.dat",ios::out|ios::app);
if(n==4)
fo.open("bio_inst.dat",ios::out|ios::app);
while(1)
{
Inst.Sno=sizeof_inst(n);
gotoxy(25,5);
cout<<"SERIAL NUMBER : ";
gotoxy(25,6);
120. /*-------------------------------
INSTRUMENTS DETILS
-----------------------------------*/
void Working ::Show_inst(int n)//To display the values of instruments /
accessories
{
clrscr();
char ch;
ifstream fin;
if(n==1)
fin.open("phy_inst.dat",ios::in,ios::app);
if(n==2)
fin.open("chem_inst.dat",ios::in,ios::app);
if(n==3)
fin.open("comp_inst.dat",ios::in,ios::app);
if(n==4)
fin.open("bio_inst.dat",ios::in,ios::app);
int m;
cout<<"n";
cout<<"ttt I N S T R U M E N T S D E T A I L S n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>m;
fin.seekg(0);
while(!fin.eof())
{
fin.read((char*)&Inst,sizeof(Inst));
if(Inst.Sno==m)
121. {
clrscr();
gotoxy(30,8);
cout<<"SERIAL NO : "<<Inst.Sno;
gotoxy(30,9);
cout<<"TYPE : "<<Inst.type;
gotoxy(30,10);
cout<<"NAME : "<<Inst.name_inst;
gotoxy(30,11);
cout<<"COMPANY : "<<Inst.company;
gotoxy(30,12);
cout<<"NUMBER OF ITEMS : "<<Inst.numb_inst;
gotoxy(30,13);
cout<<"COST ( in Rs ) : "<<Inst.cost;
cout<<"nnnnttttPress ANY KEY ...";
}
}
fin.close();
}
int Working ::sizeof_spec()
{
ifstream fin;
int no;
fin.open("Specimen.dat",ios::in);
fin.seekg(0,ios::end);
long pos=fin.tellg();
no=pos/sizeof(spec);
no++;
122. fin.close();
return no;
}
/*-------------------------------
ADD SPECIMEN
-----------------------------------*/
void Working::Add_spec()
{
clrscr();
cout<<"ntt A D D S P E C I M E N ";
cout<<"ntt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
ofstream fo;
fo.open("Specimen.dat",ios::out|ios::app);
while(1)
{
spec.Sno=sizeof_spec();
gotoxy(25,5);
cout<<"SERIAL NUMBER : ";
gotoxy(25,6);
cout<<"COMMON NAME : ";
gotoxy(25,7);
cout<<"SCIENTIFIC NAME : ";
gotoxy(25,8);
cout<<"TYPE : ";
gotoxy(25,9);
cout<<"NUMBER OF ITEMS : ";
gotoxy(25,10);
cout<<"COST( IN RS) : ";
gotoxy(43,5);
125. /*-------------------------------
SPECIMEN DETAILS
-----------------------------------*/
void Working :: Show_spec_details()
{
clrscr();
int n;
cout<<"n";
cout<<"ttt S P E C I M E N D E T A I L S n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>n;
ifstream fin;
fin.open("Specimen.dat",ios::in);
fin.seekg(0);
while(!fin.eof())
{
fin.read((char*)&spec,sizeof(spec));
if(spec.Sno==n)
{
gotoxy(30,8);
cout<<"SERIAL NO : "<<spec.Sno;
gotoxy(30,9);
cout<<"COMMON NAME : "<<spec.cname;
gotoxy(30,10);
cout<<"SCIENTIFIC NAME : "<<spec.sname;
gotoxy(30,11);
126. cout<<"TYPE : "<<spec.type;
gotoxy(30,12);
cout<<"NUMBER OF ITEMS : "<<spec.number;
gotoxy(30,13);
cout<<"COST : "<<spec.cost;
cout<<"nnnnttttPRESS ANY KEY ...";
break;
}
}
fin.close();
}
/*-------------------------------
MODIFY SPECIMEN
-----------------------------------*/
void Working :: Modify_specimen()
{
clrscr();
int newcost, newnos;
char newcname[30],newsname[30], newtype[30];
fstream sys;
sys.open("Specimen.dat",ios::in|ios::out|ios::binary);
long curpos;
cout<<"n";
cout<<"ttt M O D I F Y S P E C I M E N n";
cout<<"ttt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n";
int modcode;
gotoxy(30,6);
cout<<"ENTER THE SERIAL NUMBER : ";
cin>>modcode;
127. while(!sys.eof())
{
curpos=sys.tellg();
sys.read((char*)&spec,sizeof(spec));
if(chem.Sno == modcode)
{
gotoxy(20,8);
cout<<"SERIAL NO : "<<spec.Sno;
gotoxy(20,9);
cout<<"COMMON NAME : "<<spec.cname;
gotoxy(20,10);
cout<<"SCIENTIFIC NAME : "<<spec.sname;
gotoxy(20,11);
cout<<"TYPE : "<<spec.type;
gotoxy(20,12);
cout<<"NUMBER OF ITEMS : "<<spec.number;
gotoxy(20,13);
cout<<"COST : "<<spec.cost;
gotoxy(15,20);
cout<<"ENTER '.' TO RETAIN THE VALUES OF
CHARACTER";
gotoxy(15,21);
cout<<"RETYPE THE NUMBER TO RETAIN";
gotoxy(55,9);
gets(newcname);
gotoxy(55,10);
gets(newsname);
gotoxy(55,11);