KEND NDRI YAVI DYALAYANO 1, MADURAI2 COM OMPUTERI NVESTI GATOR ORYPROJ OJ ECT
SCHOOLMANAGEMENT
Gui de dby: SHRI . AMANGUPTA, PGT( COMP) Doneby : C. Ra mMuki l a nXI IA1, S. P . Sr iNi r dhe e s hwa rXI IA1 , K. G. Ga ut a mXI IA1.
SCHOOLMANAGEMENT PROJ OJ ECTREPORT I nPa r t i a l f ul f i l l me nto ft h er e q ui r e me nt s Fo rt h ea wa r do ft h eCl a s so f
COMPUTER Sub mi t t e dBy C. Ra mMuki l a nXI IA1, S. P . Sr iNi r dhe e s hwa rXI IA1 , K. G. Ga ut a mXI IA1.
UNDERTHE HEGU GUI DANCEOF OF
SHRI . AMANGUPTA, PGT( COMP) CBSEAI SSCE2013–2014 KEND NDRI YAVI DYALAYANO 1 NARI MEDU DU, MADU DURAI–2
SCHOOLMANAGEMENT PROJ OJ ECTREPORT I nPa r t i a l f ul f i l l me nto ft h er e q ui r e me nt s Fo rt h ea wa r do ft h eCl a s so f
COMPUTER Sub mi t t e dBy C. Ra mMuki l a nXI IA1, S. P . Sr iNi r dhe e s hwa rXI IA1 , K. G. Ga ut a mXI IA1.
UNDERTHE HEGU GUI DANCEOF OF
SHRI . AMANGUPTA, PGT( COMP) CBSEAI SSCE2013–2014 KEND NDRI YAVI DYALAYANO 1 NARI MEDU DU, MADU DURAI–2
TABLEOFCONTENTS SL. NO.
TOPI C
1
Bonaf i deCe r t i f i c a t e
2
De c l a r a t i on
3
Ac knowl e dge me nt
4
I nt r oduc t i ont oc ++
5
I nt r oduc t i ont oPr oj e c t
6
Codi ngs
7
Out put s
8
Bi bl i ogr a phy
BONAFI DECERTI FI CATE SCHOOL Thi s i s t o c e r t i f y t ha t t he pr oj e c t e nt i t l e d “ MANAGEMENT”i sar ec or d ofBonaf i dewor kc ar r i edoutby C. Ra m Muki l a n XI IA1,S. P. Sr iNi r dhe e s hwa rXI IA1, “ K. G. Ga ut a m XI IA1“.Inpart i a lf ul f i l me ntoft her e qui r e me nt si n COMPUTERpr e s c r i be dbyCBSEf orAI SSCE20132014 i nt hes c hool Kendr i yaVi dya l ay aNar i medu, Madur ai 625002
DATE
I NTERNALEXAMI NER
PRI NCI PAL
EXTERNALEXAMI NER
DECLARATI ON Wehe r e byde c l a r et ha tt hepr oj e c twor ke nt i t l e d “ SCHOOLMANAGEMENT“ . Submi t t e dt oKENDRI YA VI DYALAYA ( NO. 1) , MADURAI f ort he Subj e c tof“ COMPUTER“ . Undert hegui danc eofSHRI . AMAN GUPTA,PGT( COMP) ,I sa r e c o r dofor i gi na lwor kdonebyus . Wef ur t he rDe c l a r et ha tt hi spr oj e c tr e c or dora nypa r toft hi sha snot be e nSubmi t t e de l s e whe r ef ora nyot he rc l a s s .
DATE
PLACE:
( MEMBERS)
ACKNOWLEDGEMENT
Wewi s ht oe x pr e s sours i nc e r et ha nkst oMr . C. MUTHI AHPr i nc i pa l , Ke ndr i y aVi dy a l a y a( no. 1 )Na r i me du, Ma dur a if org ui di ngust oc a us e t hes uc c e s s f ulout c omeoft hi spr oj e c twor k
Wewi s ht oe x pr e s sourde e p& pr of ounds e ns eofgr a t i t udet oourgui de t e a c h e rSHRI . AMANGUPTA,PGT( COMP) , Forhi se x pe r the l p& v a l ua bl egui da nc e , c omme nt sa nds ugge s t i ons
Wewi s ht oe x pr e s sourde e p& pr of ounds e ns eofgr a t i t udet oourgui de t e a c h e rSHMT. SMI THAPRIYA, f orhe re x p e r the l p& v a l ua bl e gui dance , c omment sands ugges t i ons
Wea l s opl a c eonr e c or d, ours i nc e r eGr a t i t udet oonea nda l lwho, Di r e c t l yorI ndi r e c t l y, Ha v eLe ntt he i rhe l pi ngha ndi nt hi sv e nt ur e
I NTRODUCTI ONTO C++ C++i sapr ogr ammi ngLanguageDev el opedbyBj ar neSt r ous t r up.I t wa sor i gi na l l yna me da sC wi t hc l a s s e s ,wa sr e na me da sC++i n1983. I ti s r e ga r de da sa ni nt e r me di a t e l e v e ll a ng ua ge ,a si tc ompr i s e sb ot hhi ghl e v e l a ndl owl e v e ll a ng ua g ef e a t ur e s .I t sa ppl i c a t i ondoma i nsi nc l udes y s t e ms s of t wa r e ,a ppl i c a t i ons of t wa r e ,de v i c edr i v e r s ,e mbe dde ds of t wa r e ,hi g hpe r f or ma nc es e r v e ra ndc l i e nta ppl i c a t i ons ,a nde nt e r t a i nme nts of t wa r e s ucha v si de oga me s .C+ +c o nt i nue st obeus e da ndi so neoft hepr e f e r r e d pr ogr a mmi ngl a ng ua g e st ode v e l oppr of e s s i ona la ppl i c a t i ons TheFe a t ur e sofC++a saLa ngua ge Nowt ha ta l lt hene c e s s a r yt he or yha sbe e nc ov e r e d, nowi ti spos s i bl et o e x p l a i nwha tC+ +ha st oof f e ra sapr ogr a mmi ngl a ng ua g e . C+ +. . . . •
. . . i sa nope ns our c eI SOs t a nda r di z e dl a ng ua g e . Forat i me , C+ +ha dnoof f i c i a ls t a nda r da ndwa sma i nt a i ne dbyad e -
f a c t os t a nda r d, howe v e rs i nc e1 99 8, C+ +i ss t a nda r di z e dbyac o mmi t t e eof t heI SO. •
. . . i sac ompi l e dl a ngua ge . C++c ompi l e sdi r e c t l yt oama c hi ne ' sna t i v ec ode , a l l owi ngi tt obeone
oft hef a s t e s tl a ngua ge si nt hewor l d, i fopt i mi z ed. •
. . . s uppor t sbot hs t a t i ca nddy na mi ct y pec he c ki ng . C+ +a l l owst y pec o nv e r s i onst obec he c k e de i t he ra tc o mpi l e t i meor
a tr unt i me , a ga i nof f e r i nga not he rde gr e eoff l e x i bi l i t y . Mos tC++t y pe c he c ki ngi s , howe ve r , s t a t i c . •
. . . i spor t a bl e .
Aso neo ft hemos tf r e q ue nt l yus e dl a ng ua g e si nt hewor l da nda sa nope n l a ngua ge , C++ha sawi der a ngeofc ompi l e r st ha tr unonma nydi f f e r e nt pl a t f or mst ha ts uppor ti t . Codet ha te x c l us i v e l yus e sC++' ss t a nda r dl i br a r y wi l lr unonma nypl a t f or mswi t hf e wt onoc ha nge s .
I NTRODUCTI ONTO PROJ ECT Ev e r ySc hoolne e d st oma i nt a i nDa t aba s e soft hes t ude nt s ,t e a c he r sa nd s t a f fe t c . ,Theda t aba s eont hes t ude nt si sr e qui r e df org e ne r a lpur pos e l i kec ol l e c t i onf e e s ,i nLi br a r yf ort hei s s ueofbooksa ndobt a i nba c kt he s ameandi nt heLabor at ory ,r egar di ngi s s ueofappar at usanddamage c a us e di fa ny .
Sc hoolmanagementi saSof t war edev el opedbyat ea m ofs t udent svi z S. P. Sr iNi r dhee s hwa r ,C.Ra m Muki l a n,K. G.Ga ut ham ofXI IA Iof KVS1, Madur ai aspar toft hec ur r i c ul umofXI Is t andar dCBSE. Us i ngt hi sSof t war e,undert heOf f i c emodul e,t hedat abas eon t he s t udent sandt ea ches& s t af fca nbecr ea t ed,modi f i ed.Thes ameca nbe us e dt ov e r i f ywhe t he ra nys t ude nti sduef o rpa y me ntoft e r mf e e se t c . Thi sc a nbeus e di nt heLi br a r y , La bor a t or ymodul e s . I nt heLi br a r ymodul eoft hes o f t wa r e ,ada t a b a s eo nt hea v a i l a b l ebooks wi t ha ut hornumbe r ,noofbooks ,c os tofbooke t c . ,c a n bec r e a t e d, modi f i e df r om t i met ot i me .Byl i nk i ngwi t ht hes t ude nt sda t a b a s e ,t he i s s ueofbooksc a nbee nt e r e da g a i ns tt hena meoft hes t ude nt s . I ft hebook i sr e t ur ne d,t hes a mec a nbee nt e r e di nt hes of t wa r e . He nc ea ta nypoi ntof t i me ,i ti spos s i bl et oge tt hede t a i l soft hebookst a ke nbya nys t ude ntc a n beobt a i ne d.Wec a nc he c kt hea v a i l a bi l i t yofa nybooki nt heLi br a r ya t a nypoi ntoft i me .Si mi l a r l y ,wec a ne x t e ntt hes o f t wa r ei nf ut ur et oge tt he
l i s tofs t ude nt sha vi nga nypa r t i c ul a rbooka ta nypoi ntoft i me . I nt heLa b or a t or ymodul e ,f ourl a b sa r ei nc l ude dv i zPhy s i c s ,Che mi s t r y , Bi ol ogy , Comput e rSc i e nc e . Thel i s tofe qui pme nta v a i l a bl ea ndt he i rc o s t i si nc l ude dunde re a c hl a b or a t or y .Thes o f t wa r ec a nbee x t e nde dt oe nt e r t henamea ndquant i t yofa ppar a t usda mag e dbyanys t udenta gai ns t hi m/ hera nd c os tt ober e c ove r edf r om hi m/ herc a n beas s e s s e da nd c ol l e c t e d.Ti l li ti spa i d,i twi l lb es howna sout s t a ndi nga ga i ns tt ha t s t u d e n t . Thi ss of t wa r ei sus e f ult oma i nt a i nupda t e da nde r r orf r e es t a t usofa l lt he s t ude nt s / t e a che r s ,c ol l e c t / c r e di tt hef e e s / s a l a r y . Andt oVe r i f ywhe t he rt he s t ude ntha sr e t ur ne da l lt hebooksa ndpa i da l lt hedue s . TheMot i v eoft hi ss of t wa r ei st odi l ut et hewor kofof f i c es t a f f s ,a ndt o r e duc et heus eofpa pe r .
CODI NGS #i nc l ude
#i nc l ude #i nc l ude #i nc l ude #i nc l ude #i nc l ude #i nc l ude #i nc l ude / * f i l e sus e d * / f s t r e ambl i s t , ml i s t , i s s f i l e ; / * STRUCTURES * / s t r uc tuda t { i ntda y i ntmon
; ;
i nty e a r ; } ; s t r uc tbda t a { i ntbc o de ; c harbname[ 50];
c ha ra ut h[ 50]; c ha rpubl[ 5 0]; i ntpr i c e ; i ntc opi e s; } book; s t r uc tmda t a { i ntmc ode ; c ha rmna me[ 20]; i nts t d
;
c ha rc ont a c t [ 15] ; } me mbe r ; s t r uc ti s s de t { i ntmc ode ; c ha rmna me[ 20]; i ntmbcode ; uda ti s s ue ; uda tr e t da t; } i de t ; s t r uctChemi ca l { i ntSno ; i ntNos ; i ntVol ; i ntConc ; c harNa me[ 30];
c ha rDOE [ 30 ]; } c hem; s t r uc ts y s t e m { i ntno
;
i ntmr y ; i ntr a m
;
c ha rpr c s[ 30]; c ha ros[ 30]; charc mpy[ 30]; l ongc os t ; } p c ; s t r uc tI ns t r ume nt s { i ntSno
;
i ntnumb_ i ns t; i ntc os t
;
c ha rt y pe [ 30]; c ha rna me _ i ns t [ 3 0]; charc ompany[ 30]; } I ns t ; s t r uc tSpe c i me n { i ntc os t
;
i ntnumber ;
i ntSno
;
charc name [ 50]; c ha rt y pe [ 30]; c h a rs na me [ 5 0]; c ha rDOE [ 20 ]; } s p e c ; s t r uctme mber { i ntpc o de
;
charpname [ 40]; l ongf i ne
;
} pm; / * f unc t i onpr ot ot y pe s * / v oi dwe l c ome ( ) ; v oi di nt e r f a c e( ) ; v oi dpa s s wor d( ) ; v oi dl i br a r y( ) ; v oi dl a bs ( ) ;
/ * ba s i ci nf of ors t ude nt * / c l a s sba s i c { publ i c:
charname[ 80] ; c ha rdob[ 1 5] ; c ha rf a t he r _ na me [ 8 0] ; c harmot her _name[ 80] ; c ha ra ddr e s s [ 80] ; c ha rc ont a c t [ 15] ; c ha rr e l i gi on[ 20] ; c ha rna t i ona l t y [ 20] ; c ha rl a ng ua g e [ 5 0] ; c ha rc ur r e nt _s t a t [ 10] ; i ntpda y , pmont h, py e a r ; / /da t eo nwhe nf e ewa spa i d. . v oi dge t v a l ue s 1( ) ; } ; / * a dvi nf of ors t ude nt * / c l a s sa dv s t u: publ i cba s i c { publ i c: i nta dmi n_no; i nts t d; c ha rf e e_s t a t [ 20] ; v oi dge t v al ue s 2 ( ) ; } s 1 ;
/ * ba s s i ci nf of ort e a c he r * / c l a s sa dv t e ac h: publ i cba s i c { publ i c: i nts t a f f _no; c ha rs a l a r y _s t a t [ 30] ; v oi dge t v a l ue s 3( ) ; } t 1 ; / * c l a s sme nuf orl i br a r y * / c l a s sl i bme nu { publ i c : i ntda y , mon, y e a r; v oi ddue da t e( i nt , i nt , i nt ); v oi dupda t e c opi e s( i nt , i nt ); v oi dma i nme nu( ) ; v oi di s s ue ( ) ; v oi dr e t ur nbook( ) ; v oi dme mopt ( ) ; v oi dmde t a i l s( ) ; v oi dme ml i s t( ) ; v oi di s s ue de t( ) ; v oi dbookopt( ) ;
v oi dbookl i s t( ) ; v oi da ddbooks( ) ; v oi dwr i t e book( ) ; v oi dbde t a i l s( ) ; v oi dbmodi f y( ) ; } l i br ; / * c l a s sf orof f i c e * / c l a s sof f i c e _f unc t i on { p u b l i c : v oi ddi s pl a y _a dv _s t ude nt ( ) ; v oi ddi s pl a y _ba s i c _s t ude nt ( ) ; v oi ddi s pl a y _ba s i c _t e a c he r ( ) ; v oi ddi s pl a y _a dv _t e a c he r ( ) ; v oi dmodi f y _s t ude nt ( ) ; v oi da dd_s t ude nt( ) ; v oi dmodi f y _t e a c he r ( ) ; v oi da dd_t e a c he r ( ) ; v oi ddi s pl a y _s t ude nt ( ) ; v oi ddi s pl a y _t e a c he r ( ) ; i nts i z e_s t ude nt ( ) ; i nts i z e _t e ac he r ( ) ; v oi ddi s pl a y _a l l _s t ude nt s ( ) ; v oi df e e ( ) ; v oi df e e _c he c k( ) ;
v oi dpa y _f e e ( i nt ) ; v oi dc r e di c t _s a l a r y ( i nt ) ; v oi ds a l a r y _c he c k( ) ; v oi ds a l a r y ( ) ; v oi ddi s pl a y _a l l _t e a c he r s ( ) ; v oi dme nu_s t ude nt ( ) ; v oi dme nu_t e a c he r ( ) ; v oi dme nu_ma i n( ) ; } f f ; / * da t ef orof f i c e e * / t i me _tt he Ti me=t i me ( NULL) ; s t r uctt m* aTi me=l ocal t i me( &t heTi me) ; i ntday=a Ti me >t m_md mday ; i ntmont h=aTi me>t m_mo mon+1; / /Mont hi s0-11,add1t ogetaj andec 112conc ept i nty e a r=a Ti me > t m_y e a r+1900 ;/ /Ye a ri s#y e a r ss i nc e1 90 0 / * FEEf ors t udent * / c l a s sf e eda t e {publ i c : i ntda y , mont h, y e a r; } f ;
/ * La bFi l e s * / v oi dphy l a b( ) ; v oi dc he ml a b( ) ; v oi dc ompl a b( ) ; v oi dbi ol a b( ) ; / * CLASSFORLABORATORY * / c l a s sWor k i ng { p u b l i c : v oi dbr oke n( )
;
i nts i z e of _c he m( )
;
v oi dAdd_Che mi c a l ( )
;
v oi dAv a i l a bl e _c he mi c a l s ( ); v oi dShow_c he mi c a l _de t a i l ( ); v oi dModi f y _Che mi c a l ( ) ; i nts i z eof _s y s t e m( ) v oi dAdd_s y s t e m( )
; ;
v oi dSy s t e m_pr e s e nt ( ) ; v oi dShow_s y s t e m_de t a i l ( ); v oi dModi f y _s y s t e m( ) ; i nts i z e of _i ns t ( i nt ) ; v oi dAdd_i ns t ( i nt ) v oi dShow_i ns t ( i nt )
; ;
i nts i z e of _s pe c ( ) v oi dAdd_s pe c ( )
; ;
v oi dAv a i l a bl e _s pe c i me n( ); v oi dShow_s pe c _de t a i l s ( ); v oi dModi f y _s pe c i me n( ) ; } W; / * f unc t i onf orwe l c o mes c r e e n * / v oi dwe l c ome ( ) { c l r s c r ( ) ; c out < <" \ n" ; c out <<" \ t \ t* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n" ; c out <<" \ t \ t* *SCH O O L M ANAG EM ENT * * \ n" ; c out <<" \ t \ t* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n" ; got ox y ( 3, 24) ; c out <<" Aut hor s : CRAM MUKI LAN, SPSRI NI RDHESHWAR, KG GAUTAM" ; got ox y ( 23, 6) ; c out <<" WELCOMETO HOGWARTSI NTERNATI ONALE" ; got ox y ( 16, 10) ; c out <<" THI SGUI DESTO I NFORMATI ON ACCESSREGARDI NG " ; got ox y ( 16, 12) ; c out <<" ADMI NI STRATI ON, LI BRARYAND LABORATORY MANGEMENT" ; got ox y ( 20, 14) ; c out <<" THI SCANACCESED ONLYBYADMI NI STRATORS" ;
got ox y ( 24, 19) ; pa s s wor d( ) ; } / * f unc t i onf orpa s s wor d * / v oi dpa s s wor d( ) { c ha ri npa s s [ 5] ; c o ut < <" Ent e rpa s s wor d: " ; f or ( i nti =0; i <5; i ++) { i npa s s [ i ] =( c ha r ) ge t c h( ) ; c out <<" * " ; } i f ( i npa s s [ 0 ] = =' n' && i npa s s [ 1] = =' i ' && i npa s s [ 2 ] = =' g ' && i npa s s [ 3 ] = =' a ' && i npa s s [ 4] ==' r ' ) { c l r s c r ( ) ; i nt e r f a c e( ) ; } e l s e { c l r s c r ( ) ; g o t o x y ( 2 8 , 1 1 ) ; c out <<" ACCESSDENI ED! ! ! " ;
ge t c h( ) ; e x i t ( 1 ) ; } } / * ma i nme nu * / v oi di nt e r f a c e ( ) { c l r s c r ( ) ; c o ut < <" \ n\ n\ n" ; c out <<" \ t \ t \ t M EN U
\ n" ;
c out << " \ t \ t \ t ~ ~~~~~~~ ~~~~\ n" ; got ox y ( 5, 24) ; c out <<" SELECTYOURCHOI CE" ; c out <<" \ t \ t \ t \ t \ t \ t<0>f orEXI T" ; got ox y ( 25, 10) ; c out <<" 1. O FFICE" ; got ox y ( 25, 12) ; c out << " 2. LIBRARY" ; got ox y ( 25, 14) ; c out <<" 3. LABO RATO RY" ; i ntms ; got ox y ( 30, 18) ; c out << " Ent e ry ourc hoi c e : " ; c i n>>ms ; s wi t c h( ms )
{ c a s e1: f f . me nu_ ma i n( ) ; br e a k ; c a s e2: l i br a r y ( ) ; br e a k ; c a s e3: l a bs ( ) ; br e a k ; c a s e0: we l c o me ( ) ; br e a k ; d e f a u l t : got ox y ( 30, 19) ; c out <<" WRONG CHOI CE" ; } }
/ * of f i cemai nmenu * / v oi dof f i c e _f unc t i on: : me nu_ma i n( ) { i ntc h; c l r s c r ( ) ; whi l e ( 1)
{ c l r s c r ( ) ; c o ut < <" \ n\ n\ n" ; c out <<" \ t \ t WELCOMETO HOGWART' SSCHOOLOF EXCELLENCE
\ n" ;
c out <<" \ t \ t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"; c out <<" \ t \ t
ADMI NI STRATI ONWI NG
c o ut < <" \ t \ t
~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
got ox y ( 33, 12) ; c out <<" 1. STUDENTI NFO" ; got ox y ( 33, 14) ; c out <<" 2. TEACHERI NFO" ; got ox y ( 33, 16) ; c out <<" 0. EXI T" ; got ox y ( 30, 20) ; c out <<" Ent e rt hec hoi c e: " ; c i n> >c h; c l r s c r ( ) ; s wi t c h( c h) { c a s e1: menu_s t udent ( ) ; br e a k; c a s e2: me nu_ t e a c he r ( ) ; br e a k; c a s e0: i nt e r f a c e( ) ;
" ;
\ n" ;
} ge t c h( ) ; } } / * s i z eofs t ude nt * / i ntof f i c e _f unc t i on: :s i z e _s t ude nt ( ) { i ntno; i ntpos ; i nts i z e ; f s t r e a mout ; out . ope n( " DATA. da t " , i os : : i n| i os : : out ) ; out . s e e kg( 0, i os : : e nd) ; p o s = o u t . t e l l p ( ) ; s i z e = s i z e o f ( s 1 ) ; n o = p o s / s i z e ; no++; out . c l os e ( ) ; r e t ur nno; } / * s t udentme nu * / v oi dof f i c e _f unc t i on: : me nu_s t ude nt ( )
{ i ntc h; whi l e ( 1) { c l r s c r ( ) ; c o ut < <" \ n\ n\ n" ; c out << " \ t \ t \ t STUDENT INFO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; got ox y ( 30, 8) ; c out <<" 1. ENROLLASTUDENT" ; got ox y ( 30, 10) ; c out <<" 2. DI SPLAYASTUDENT" ; got ox y ( 30, 12) ; c out << " 3. MODI FY" ; got ox y ( 30, 14) ; c out << " 4. FEEDETAI LS" ; got ox y ( 30, 16) ; c out <<" 0. EXI T" ; got ox y ( 25, 20) ; c out <<" ENTERYOU OURCHOI CE: " ; / / t ex t bac kgr ound( W HI TE) ; / / t ex t c ol or ( CYAN+BLI NK) ; c i n> >c h; s wi t c h( c h) { c a s e1: s 1 . ge t v al ue s 2( ) ; br e a k ; c a s e2:
di s pl a y _s t ude nt ( ) ; br e a k ; c a s e3: mo modi f y _ s t ude nt ( ) ; br e a k ; c a s e4: f e e( ) ; br e a k ; c a s e0: me me nu_ma ma i n( ) ; } ge t c h( ) ; } } / * g ets t ude ntda t a * / v oi dba s i c : : ge t v a l ue s 1( ) { c l r s c r ( ) ; pday=0; pmo mont h=0 ; p y e a r = 0 ; c out <<" \ n\ t \ t ENTER INFO RM ATIO N
" ;
c o ut < <" \ n\ t \ t~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~\ n" ; g o t o x y ( 1 0 , 2 4 ) ; c out <<" PLEASEENT NTERTHEDETAI LSON ONLYI N CAPTI ALLETTERS" ;
g o t o x y ( 2 5 , 5 ) ; c out << " NAME
: " ;
g o t o x y ( 2 5 , 6 ) ; c out <<" DATEOFBI RTH : " ; g o t o x y ( 2 5 , 7 ) ; c out <<" FATHERNAME : " ; g o t o x y ( 2 5 , 8 ) ; c out <<" MOTHERNAME : " ; g o t o x y ( 2 5 , 9 ) ; c out <<" ADDRESS
: " ;
g o t o x y ( 2 5 , 1 0 ) ; c out <<" CONTACT
: " ;
g o t o x y ( 2 5 , 1 1 ) ; c out << " RELI GI ON
: " ;
g o t o x y ( 2 5 , 1 2 ) ; c out <<" NATI ONALI TY : " ; g o t o x y ( 2 5 , 1 3 ) ; c out <<" LANGUAGE
: " ;
g o t o x y ( 2 5 , 1 4 ) ; c out << " STATUS( I N/ OUT): " ; g o t o x y ( 4 3 , 5 ) ; g e t s ( na me ) ; g o t o x y ( 4 3 , 6 ) ; g e t s ( d o b ) ; g o t o x y ( 4 3 , 7 ) ; g et s ( f a t he r _ na me ) ; g o t o x y ( 4 3 , 8 ) ; get s ( mot her _name) ; g o t o x y ( 4 3 , 9 ) ;
g e t s ( a d d r e s s ) ; g o t o x y ( 4 3 , 1 0 ) ; ge t s ( c ont a c t ) ; g o t o x y ( 4 3 , 1 1 ) ; ge t s ( r e l i gi on) ; g o t o x y ( 4 3 , 1 2 ) ; ge t s ( na t i ona l t y ) ; g o t o x y ( 4 3 , 1 3 ) ; ge t s ( l a ngua ge ) ; g o t o x y ( 4 3 , 1 4 ) ; ge t s ( c ur r e nt _s t a t ) ; } / * g e ta dvs t ude ntda t a * / v oi da dv s t u: : ge t v a l ue s 2( ) { ge t v a l ue s 1( ) ; got ox y ( 25, 15) ; c out <<" CLASS
: " ;
got ox y ( 25, 16) ; c out << " FEESTATUS : " ; got ox y ( 25, 17) ; c out <<" ( PAI D/ NOTPAI D)" ; got ox y ( 43, 15) ; c i n>>s t d; got ox y ( 43, 16) ;
g e t s ( f e e _s t a t ) ; f f . a dd_s t ude nt ( ) ; } / * adds t udent * / v oi dof f i c e _f unc t i on: : a dd_s t ude nt ( ) { c l r s c r ( ) ; c ha rc h; c o u t < < " \ n \ n " ; c out <<" \ t \ t \ t AD M ISSIO N
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" DO YOUWANTTO SAVETH THI SRECORD ( Y/ N): " ; c i n > > c h ; i f ( c h==' y ' | | c h==' Y' ) { g o t o x y ( 2 0 , 1 2 ) ; c out <<" PLEASENOTEDOW NTHEADMI SSI ONNO . . " ; s 1 . a dmi n_ no= s i z e _s t ude nt ( ) ; c out <<" \ n\ n\ t \ t \ t \ t " <
of s t r e a m ml i s t ; me mbe r . mc ode= s 1. a dmi mi n_no; s t r c py ( member . mname , s 1. name me) ; me mb mbe r . s t d= s 1 . s t d; s t r c py ( me mb mbe r . c ont a c t , s 1. c ont a c t ) ; ml i s t . ope n( " me ml ml i s t . da t " , i os : : a pp| i os : : out ) ; ml i s t . wr i t e ( ( c ha r * ) &me mb mbe r , s i z e of ( me mb mbe r ) ) ; ml i s t . c l os e ( ) ; / /l a b of s t r e ampl i s t ; pm. m. pcode=s 1. a dmi mi n_no; s t r c p y ( pm. pna me me , s 1 . na me me ) ; pm. f i ne = 0 ; pl i s t . ope n( " me mb mbe r . da t " , i os : : a pp| i os : : out ) ; pl i s t . wr i t e ( ( c ha r * ) &pm, s i z eof ( pm) ) ; pl i s t . c l os e ( ) ; } e l s e { me me nu_ma ma i n( ) ; } } ; / * di s pl a yme nu-s t ude nt * / v oi dof f i c e _f unc t i on: : di s pl a y _s t ude nt ( )
{ i ntc h1; c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t STUDENT D ISPLAY
\ n" ;
c o ut < <" \ t \ t \ t~ ~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~\ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" 1. BASI CI NFOR ORMATI TI ON " ; g o t o x y ( 3 0 , 1 0 ) ; c out <<" 2. ADVANCEI NFOR ORMATI ON " ; g o t o x y ( 3 0 , 1 2 ) ; c out << " 3. DI SPLAYALL" ; g o t o x y ( 3 0 , 1 4 ) ; c out <<" 0. EXI T" ; g o t o x y ( 2 5 , 1 8 ) ; c out <<" Ent e rt hec hoi c e: " ; c i n> > c h 1 ; c l r s c r ( ) ; s wi t c h( c h1 ) { c a s e1: di s pl a y _ba s i c _s t ude nt ( ) ; br e a k; c a s e2: d i s p l a y _ a d v _ s t u d e n t ( ) ; br e a k; c a s e3: di s pl a y _a l l _s t ude nt s ( ) ; br e a k;
c a s e0: we l c ome ( ) ; } } / * di s pl a ys t ude nt * / v oi dof f i c e _f unc t i on: :di s pl a y _ba s i c _s t ude nt ( ) {c l r s c r ( ) ; i ntr n; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t STUDENT INFO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" ENTERTHEADMI NNO : " ; c i n > > r n ; c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t STUDENT INFO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; i f s t r e a mi n; i n. ope n( " da t a . da t " ) ; i n. s e e kg( 0) ; whi l e ( ! i n. e of ( ) ) { i n. r e ad( ( c ha r * ) &s 1 , s i z e of ( s 1 ) ) ; i f ( s 1 . a dmi n_ no= =r n)
{
got ox y ( 30, 8) ; c out <<" Admi nno : " <
: " <
g o t o x y ( 3 0 , 1 2 ) ; c out <<" Da t eofbi r t h: " <
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" ENTERTHEADMI NNO : " ; c i n > > r n ; c l r s c r ( ) ;
c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t STUDENT INFO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; i f s t r e a mi n; i n. ope n( " da t a . da t " ) ; i n. s e e kg( 0) ; whi l e ( ! i n. e of ( ) ) { i n. r e ad( ( c ha r * ) &s 1 , s i z e of ( s 1 ) ) ; i f ( s 1 . a dmi n_ no= =r n) { g o t o x y ( 3 0 , 8 ) ; c out << " ADMI NNO
: " << s 1. a dmi n_no;
g o t o x y ( 3 0 , 9 ) ; c out << " NAME
: " << s 1. name ;
g o t o x y ( 3 0 , 1 0 ) ; c out <<" DATEOFBI RTH : " <
: " <
g o t o x y ( 3 0 , 1 4 ) ; c out <<" CONTACT
: " <
g o t o x y ( 3 0 , 1 5 ) ; c out <<" NATI ONALI TY : " <
c out << " LANGUAGE
: " << s 1. l a nguag e ;
g o t o x y ( 3 0 , 1 7 ) ; c out <<" FEESTATUS : " <
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; c out <<" \ n" ;
c out <<" \ n ADMI N
STUDENTNAME
CONTACT
FEESTATUS " ; c o u t < < " " ; f s t r e amf i l e ; f i l e . ope n( " da t a . da t " , i os : : out | i os : : i n) ; whi l e ( 1) { f i l e . r e a d( ( c ha r * ) &s 1 , s i z e of ( s 1) ) ; i f ( f i l e . e of ( ) ) br e a k; f or ( i nti =0; i <100; i ++) { i f ( s 1. a dmi n_no==i ) {x = x +2; g o t o x y ( 7 , x ) ; c out <
} f i l e . c l os e ( ) ; ge t c h( ) ; } / * modi f ys t udent * / v oi dof f i c e _f unc t i on: : modi f y _s t ude nt ( ) {c ha r ne wna me [ 8 0] , ne wf a t he r [ 8 0] , ne wmot he r [ 8 0] , ne wa ddr e s s [ 1 20 ] , ne wdob[ 1 2] , n e wc o nt a c t [ 1 0] ; c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out <<" \ t \ t \ t M O DIFYSTUDENT
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~\ n" ; f s t r e amf i o( " DATA. da t " , i os : : i n| i os : : out | i os : : bi na r y ) ; i ntr n; c out <<" \ t ENTERTHEADMI NNO : " ; c i n > > r n ; g o t o x y ( 2 0 , 2 4 ) ; c out <<"<. >t or e t a i nt heva l ue s" ; whi l e ( ! f i o. e of ( ) ) {
f i o. r e a d( ( c ha r * ) &s 1, s i z e of ( s 1) ) ; i f ( s 1 . a dmi n_ no= =r n) { g o t o x y ( 1 0 , 8 ) ; c out << " ADMI N NO
: " <
g o t o x y ( 1 0 , 9 ) ; c out << " NAME
: " << s 1. name ;
g o t o x y ( 1 0 , 1 0 ) ; c out <<" DATEOFBI RTH : " <
: " <
g o t o x y ( 1 0 , 1 5 ) ; c out <<" NATI ONALI TY : " <
g o t o x y ( 5 0 , 9 ) ; get s ( newname) ; g o t o x y ( 5 0 , 1 0 ) ; ge t s ( ne wf a t he r ) ; g o t o x y ( 5 0 , 1 1 ) ; g e t s ( ne wmo t he r ) ; g o t o x y ( 5 0 , 1 2 ) ; g e t s ( ne wa ddr e s s ) ; g o t o x y ( 5 0 , 1 3 ) ; g e t s ( ne wc ont a c t ) ; i f ( s t r c mp( ne wna me , " . " ) ! =0) {
s t r c p y ( s 1 . na me , ne wna me ) ; } i f ( s t r c mp( ne wf a t he r , " . " ) ! =0) { s t r c py ( s 1. f a t he r _na me , ne wf a t he r ) ; } i f ( s t r c mp( ne wmot he r , " . " ) ! =0) { s t r c p y ( s 1 . mot he r _ na me , ne wmot he r ) ; } i f ( s t r c mp( ne wa ddr e s s , " . " ) ! =0) { s t r c py ( s 1 . a ddr e s s , ne wa ddr e s s ) ; } i f ( s t r c mp( ne wc ont a c t , " . " ) ! =0) { s t r c py ( s 1 . c ont a c t , ne wc ont a c t ) ; } c ha rc h; g o t o x y ( 1 0 , 2 0 ) ; cout <<" Wantt oAppl yt heChanges( y/ n) " ; c i n > > c h ; i f ( c h==' y ' | | c h==' Y' ) { f i o. s e e kp( f i o. t e l l g( )-s i z e of ( s 1) ) ; f i o. wr i t e ( ( c ha r * ) &s 1, s i z e of ( s 1) ) ;
f i o. c l os e ( ) ; g o t o x y ( 1 0 , 2 1 ) ; c out <<" MODI FI ED" ; br e a k; } } } ge t c h( ) ; }
/ * t ea c hermenu * / v oi dof f i c e _f unc t i on: : me nu_t e a c he r ( ) { i ntc h; whi l e ( 1) { c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t TEACH ER IN FO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" 1. ENROLLATEACHER" ; g o t o x y ( 3 0 , 1 0 ) ; c out <<" 2. DI SPLAYATEACHER" ;
g o t o x y ( 3 0 , 1 2 ) ; c out << " 3. MODI FY" ; g o t o x y ( 3 0 , 1 4 ) ; c out <<" 4. SALARYSTATUS" ; g o t o x y ( 3 0 , 1 6 ) ; c out <<" 0. EXI T" ; g o t o x y ( 2 5 , 2 0 ) ; c out <<" ENTERYOURCHOI CE: " ; c i n > > c h ; s wi t c h( c h) { c a s e1: t 1 . g e t v a l u e s 3 ( ) ; br e a k; c a s e2: di s pl a y _t e a c he r ( ) ; br e a k ; c a s e3: modi f y _ t e a c he r ( ) ; br e a k ; c a s e4: s a l a r y ( ) ; br e a k ; c a s e0: me nu_ma i n( ) ; } ge t c h( ) ; } }
/ * s i z eoft e c he r * / i ntof f i c e _f unc t i on: : s i z e _t e ac he r ( ) { i ntno; i ntpos ; i nts i z e ; f s t r e a mout ; out . ope n( " DATA1. da t " , i os : : i n| i os : : out ) ; out . s e e kg( 0, i os : : e nd) ; p o s = o u t . t e l l p ( ) ; s i z e = s i z e o f ( t 1 ) ; n o = p o s / s i z e ; no++; out . c l os e ( ) ; r e t ur nno; } / * ge ti nf ot e c he r * / v oi da dv t e a c h: : ge t v a l ue s 3( ) { g e t v a l u e s 1 ( ) ; g o t o x y ( 2 5 , 1 5 ) ; c out <<" Sa l a r yDe t a i l s: " ;
g o t o x y ( 2 5 , 1 7 ) ; c out <<" ( CREDI CTED/ NOTCREDI CTED)" ; g o t o x y ( 4 1 , 1 5 ) ; g e t s ( s a l a r y _ s t a t ) ; f f . a dd_t e ac he r ( ) ; } / * a ddt e a c he r * / v oi dof f i c e _f unc t i on: : a dd_t e a c he r ( ) {c ha rc h; c l r s c r ( ) ; c o u t < < " \ n \ n " ; c out <<" \ t \ t \ t AD M ISSIO N
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" DO YOUWANTTO SAVETHI SRECORD ( Y/ N): " ; c i n > > c h ; ; i f ( c h==' y ' | | c h==' Y' ) { g o t o x y ( 2 0 , 1 2 ) ; c out <<" PLEASENOTEDOWNYOURSTAFFNO . . . " ; t 1. s t a f f _no=s i z e _t e ac he r ( ) ; c out <<" \ n\ n\ t \ t \ t \ t " <
out . c l os e ( ) ; } e l s e { ge t c h( ) ; me nu_ma i n( ) ; } } / * DI SPLAYMENU * / v oi dof f i c e _f unc t i on: : di s pl a y _t e a c he r ( ) { i ntc h1; c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t TEACH ER D ISPLAY
\ n" ;
c o ut < <" \ t \ t \ t~ ~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~\ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" 1. BASI CI NFORMATI ON " ; g o t o x y ( 3 0 , 1 0 ) ; c out <<" 2. ADVANCEI NFORMATI ON " ; g o t o x y ( 3 0 , 1 2 ) ; c out << " 3. DI SPLAYALL" ; g o t o x y ( 3 0 , 1 4 ) ; c o ut < <" 0 . EXI T: " ; g o t o x y ( 2 5 , 1 8 ) ; c out <<" Ent e rt hec hoi c e: " ;
c i n > > c h 1 ; c l r s c r ( ) ; s wi t c h( c h1 ) { c a s e1: d i s p l a y _ b a s i c _ t e a c h e r ( ) ; br e a k; c a s e2: d i s p l a y _ a d v _ t e a c h e r ( ) ; br e a k; c a s e3: di s pl a y_a l l _t e ac he r s ( ) ; c a s e0: we l c ome ( ) ; } } / * di s pl a yt e a c he r * / v oi dof f i c e _f unc t i on: : di s pl a y _ba s i c _t e a c he r ( ) {c l r s c r ( ) ; i ntr n; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t TEACH ER IN FO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 8 ) ; c out <<" Ent e rt heSTAFFNO t obes ea r c he d: " ; c i n > > r n ;
c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t TEACH ER IN FO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; i f s t r e a mi n; i n. ope n( " da t a 1. da t " ) ; i n. s e e kg( 0) ; whi l e ( ! i n. e of ( ) ) { i n. r e ad( ( c ha r * ) &t 1, s i z e of ( t 1) ) ; i f ( t 1. s t a f f _no==r n) {
got ox y ( 30, 8) ; c out <<" STAFFNO
: " <
g o t o x y ( 3 0 , 9 ) ; c out <<" NAME
: " <
g o t o x y ( 3 0 , 1 0 ) ; c out <<" DATEOFBI RTH : " <
i ntr n; c o u t < < " \ n \ n \ n " ;
c out << " \ t \ t \ t TEACH ER IN FO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 8 ) ; c o ut < <" Ent e rt hea d mi nnot obes e a r c he d: " ; c i n > > r n ; c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out << " \ t \ t \ t TEACH ER IN FO
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; i f s t r e a mi n; i n. ope n( " da t a 1. da t " ) ; i n. s e e kg( 0) ; whi l e ( ! i n. e of ( ) ) { i n. r e ad( ( c ha r * ) &t 1, s i z e of ( t 1) ) ; i f ( t 1. s t a f f _no==r n) { g o t o x y ( 3 0 , 8 ) ; c out <<" STAFFNO
: " <
g o t o x y ( 3 0 , 9 ) ; c out <<" NAME
: " <
g o t o x y ( 3 0 , 1 0 ) ; c out <<" DATEOFBI RTH : " <
g o t o x y ( 3 0 , 1 4 ) ; c out <<" CONTACT
: " <
g o t o x y ( 3 0 , 1 5 ) ; c out <<" NATI ONALI TY : " <
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; c out <<" \ n" ; c out <<" \ n ADMI N
TEACHERNAME
CONTACT
SALARYSTATUS " ; c o u t < < " " ; f s t r e amf i l e ; f i l e . ope n( " da t a 1. da t " , i os : : out | i os : : i n) ; whi l e ( 1) { f i l e . r e a d( ( c ha r * ) &t 1, s i z e of ( s 1 ) ) ; i f ( f i l e . e of ( ) ) br e a k; f or ( i nti =0; i <100; i ++) { i f ( t 1. s t a f f _no==i ) {x = x +2; g o t o x y ( 7 , x ) ; c o u t < < t 1 . s t a f f _ n o ; g o t o x y ( 2 2 , x ) ; c out <
c o u t < < t 1 . s a l a r y _ s t a t ; } } } f i l e . c l os e ( ) ; ge t c h( ) ; } / * MODI FYTEACHER * / v oi dof f i c e _f unc t i on: :modi f y _t e a c he r ( ) {c ha r ne wna me [ 8 0] , ne wf a t he r [ 8 0] , ne wmot he r [ 8 0] , ne wa ddr e s s [ 1 20 ] , ne wdob[ 1 2] , n e wc o nt a c t [ 1 0] ; c l r s c r ( ) ; f s t r e amf i o( " DATA1. da t " , i os : : i n| i os : : out | i os : : bi na r y ) ; i ntr n, pos ; g o t o x y ( 3 0 , 5 ) ; c out <<" ENTERTHEADMI NNO : " ; c i n > > r n ; c l r s c r ( ) ; whi l e ( ! f i o. e of ( ) ) { f i o. r e a d( ( c ha r * ) &t 1, s i z e of ( t 1) ) ; i f ( t 1. s t a f f _no==r n) {got ox y ( 10, 5) ;
c out <<" ADMI NNO : " <>newname ; g o t o x y ( 5 0 , 8 ) ; c i n> >ne wf a t he r ; g o t o x y ( 5 0 , 9 ) ; c i n>>newmot her ; g o t o x y ( 5 0 , 1 0 ) ; c i n> >ne wa d dr e s s ; g o t o x y ( 5 0 , 1 1 ) ; c i n> >ne wc o nt a c t ; i f ( s t r c mp( ne wna me , " . " ) ! =0) { s t r c p y ( t 1 . na me , ne wna me ) ; }
i f ( s t r c mp( ne wf a t he r , " . " ) ! =0) { s t r c py ( t 1. f a t he r _na me , ne wf a t he r ) ; } i f ( s t r c mp( ne wmot he r , " . " ) ! =0) { s t r c p y ( t 1 . mot he r _ na me , ne wmot he r ) ; } i f ( s t r c mp( ne wa ddr e s s , " . " ) ! =0) { s t r c py ( t 1. a ddr e s s , ne wa ddr e s s ) ; } i f ( s t r c mp( ne wc ont a c t , " . " ) ! =0) { s t r c py ( t 1. c ont a c t , ne wc ont a c t ) ; } } c ha rc h; c l r s c r ( ) ; g o t o x y ( 1 0 , 1 3 ) ; c out <<" WANNAAPPLYTHECHANGES( y / n) " ; c i n > > c h ; i f ( c h==' y ' | | c h==' Y' ) { f i o. s e e kp( f i o. t e l l g( )-s i z e of ( t 1 ) ) ; f i o. wr i t e ( ( c ha r * ) &t 1, s i z e of ( t 1) ) ; f i o. c l os e ( ) ; g o t o x y ( 1 0 , 1 5 ) ;
c out <<" MODI FI ED" ; br e a k; } e l s e { br e a k; } } ge t c h( ) ; }
v oi dof f i c e _f unc t i on: : s a l a r y ( ) {/ / i ntf e e da t e , f e e mont h, f e e y ea r ; c l r s c r ( ) ; i ntc h, r n; g o t o x y ( 3 0 , 5 ) ; c out <<" 1. ) SETSALARYDATE " ; g o t o x y ( 3 0 , 6 ) ; c out << " 2. ) PAYSALARY" ; g o t o x y ( 3 0 , 7 ) ; c out <<" YOURCHOI CE: " ; c i n > > c h ; s wi t c h( c h) { c a s e1: { c l r s c r ( ) ; f s t r e amf i l e ;
f i l e . ope n( " SALARY. da t " , i os : : i n| i os : : out ) ; whi l e ( 1) { f i l e . r e a d( ( c ha r * ) &f , s i z e of ( f ) ) ; i f ( f i l e . e of ( ) ) br e a k; g o t o x y ( 3 0 , 2 ) ; c out <<" CURRENTSALARYDATE" ; c out <<"" < > f . da y > >f . mont h>> f . y e a r ; f i l e . ope n( " SALARY. da t " , i os : : i n| i os : : out ) ; f i l e . wr i t e ( ( c ha r * ) &f , s i z e of ( f ) ) ; f i l e . c l os e ( ) ; br e a k; } c a s e2: c l r s c r ( ) ; i ntr n; g o t o x y ( 3 0 , 1 2 ) ; c out <<" ENTERTHESTAFFNO : " ; c i n > > r n ; c r e di c t _s a l a r y( r n) ; br e a k; }
} v oi dof f i c e _f unc t i on: : c r e di c t _s a l a r y ( i ntr n) {c l r s c r ( ) ; g o t o x y ( 3 0 , 1 2 ) ; c out <<" PRESSENTERTO CREDI CT" ; ge t c h( ) ; f s t r e a mc ha ng e ; c ha nge . ope n( " DATA1. da t " , i os : : i n| i os : : out ) ; whi l e ( ! c ha nge . e of ( ) ) { c ha nge . r e a d( ( c ha r * ) &s 1 , s i z eof ( t 1) ) ; i f ( t 1. s t a f f _no==r n) { i f ( s t r c mp( t 1. s a l a r y _s t a t , " NOT CREDI CTED" ) ==0) { t 1 . p d a y = d a y ; t 1. pmont h=mont h; t 1 . p y e a r = y e a r ; s t r c p y ( t 1 . s a l a r y _ s t a t , " CREDI CTED" ) ; c ha nge . s e e kp( c ha nge . t e l l g( )-s i z eof ( t 1) ) ; c ha nge . wr i t e ( ( c ha r * ) &t 1, s i z eof ( t 1) ) ; c ha nge . c l os e ( ) ; g o t o x y ( 3 0 , 1 3 ) ; c out <<" CREDI CTED. . . PRESSENTERTO CONTI NUE" ;
ge t c h( ) ; br e a k; } i f ( s t r c mp( t 1 . s a l a r y _ s t a t , " CREDI CTED" ) = =0 ) {c l r s c r ( ) ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" SALARYI SALREADY CREDI CTED" ; ge t c h( ) ; br e a k; } } i f ( c ha nge . e of ( ) ) br e ak; } ge t c h( ) ; }
v oi dof f i c e _f unc t i on: : s a l a r y _c he c k( ) {c l r s c r ( ) ; i ntpos ; f s t r e amf i l e ; f s t r e a mc ha ng e ;
f i l e . ope n( " SALARY. da t " , i os : : i n| i os : : out ) ; c ha nge . ope n( " DATA1. da t " , i os : : i n| i os : : out ) ; whi l e ( ! c ha nge . e of ( ) &&! f i l e . e of ( ) ) { f i l e . r e a d( ( c ha r * ) &f , s i z e of ( f ) ) ; i f ( f . day ==day &&f . mont h==mont h&&f . y ea r ==y ea r ) {
whi l e ( ! c ha nge . e of ( ) ) { i f ( c ha nge . e of ( ) ) br e a k; c ha nge . r e ad( ( c ha r * ) &t 1, s i z eof ( t 1) ) ; c o u t < < t 1 . p d a y ; i f ( t 1. pda y ==da y &&t 1. pmont h==mont h&&t 1. py e a r ) { c out <<" CHECKED" ; ge t c h( ) ; br e a k; } e l s e { s t r c py ( t 1. s al ar y _s t a t , " NOTCREDI CTED" ) ; c ha nge . s e e kp( c ha nge . t e l l g( )-s i z eof ( t 1) ) ; c ha nge . wr i t e ( ( c ha r * ) &t 1, s i z eof ( t 1) ) ;
}
} ge t c h( ) ; } } c ha nge . c l os e ( ) ; f i l e . c l os e ( ) ; } v oi dof f i c e _f unc t i on: : f e e ( ) {/ / i ntf e e da t e , f e e mont h, f e e y ea r ; c l r s c r ( ) ; i ntc h, r n; g o t o x y ( 3 0 , 5 ) ; c out <<" 1. ) SETFEEDATE " ; g o t o x y ( 3 0 , 6 ) ; c out <<" 2. ) PAYFEE" ; g o t o x y ( 3 0 , 7 ) ; c out <<" YOURCHOI CE: " ; c i n > > c h ; s wi t c h( c h) { c a s e2:
{c l r s c r ( ) ; g o t o x y ( 3 0 , 5 ) ; c out <<" ENTERTHEADMI NNO : " ; c i n > > r n ; c l r s c r ( ) ; i f s t r e a mi n; i n. ope n( " da t a . da t " ) ; i n. s e e kg( 0) ; whi l e ( ! i n. e of ( ) ) { i n. r e ad( ( c ha r * ) &s 1 , s i z e of ( s 1 ) ) ; i f ( s 1 . a dmi n_ no= =r n) {c l r s c r ( ) ; i f ( s 1. s t d<=6) {c l r s c r ( ) ; g o t o x y ( 3 0 , 5 ) ; c out << " * * * YOUHAVETO PAY* * * " ; g o t o x y ( 3 0 , 7 ) ; c out <<" TUTI ONFEE: 600RS" ; g o t o x y ( 3 0 , 8 ) ; c out <<" COMPUTERFEE: 150RS" ; g o t o x y ( 3 0 , 9 ) ; c out << " TOTAL: 75 0" ; g o t o x y ( 3 0 , 1 0 ) ; p a y _ f e e ( r n ) ; ge t c h( ) ; } e l s e
{c l r s c r ( ) ; g o t o x y ( 3 0 , 5 ) ; c out << " * * * YOUHAVETO PAY* * * " ; g o t o x y ( 3 0 , 7 ) ; c out <<" TUTI ONFEE: 600RS" ; g o t o x y ( 3 0 , 8 ) ; c out <<" COMPUTERFEE: 600RS" ; g o t o x y ( 3 0 , 9 ) ; c out << " TOTAL: 12 00 " ; p a y _ f e e ( r n ) ; ge t c h( ) ; }
} } br e a k; } / / e ndofc a s e c a s e1: { c l r s c r ( ) ; f s t r e amf i l e ; f i l e . ope n( " FEEDATE. da t " , i os : : i n| i os : : out ) ; whi l e ( 1) {
f i l e . r e a d( ( c ha r * ) &f , s i z e of ( f ) ) ; i f ( f i l e . e of ( ) ) br e a k; g o t o x y ( 3 0 , 2 ) ; c out <<" CURRENTFEEDATE" ; c out <<"" < > f . da y > >f . mont h>> f . y e a r ; f i l e . ope n( " FEEDATE. da t " , i os : : i n| i os : : out ) ; f i l e . wr i t e ( ( c ha r * ) &f , s i z e of ( f ) ) ; f i l e . c l os e ( ) ; br e a k; } } } v oi dof f i c e _f unc t i on: : pa y _f e e ( i ntr n) { got ox y ( 30, 12) ; c out <<" PRESSENTERTO PAY" ; ge t c h( ) ; f s t r e a mc ha ng e ; c ha nge . ope n( " DATA. da t " , i os : : i n| i os : : out ) ; whi l e ( ! c ha nge . e of ( ) ) {
c ha nge . r e a d( ( c ha r * ) &s 1 , s i z eof ( s 1 ) ) ; i f ( s 1 . a dmi n_ no= =r n) { i f ( s t r c mp( s 1 . f e e _ s t a t , " UNPAI D" ) = =0 ) { s 1 . p d a y = d a y ; s 1. pmont h=mont h; s 1 . p y e a r = y e a r ; s t r c py ( s 1 . f e e _s t a t , " PAI D" ) ; c ha nge . s e e kp( c ha nge . t e l l g( )-s i z eof ( s 1 ) ) ; c ha nge . wr i t e ( ( c ha r * ) &s 1 ,s i z eof ( s 1 ) ) ; c ha nge . c l os e ( ) ; g o t o x y ( 3 0 , 1 3 ) ; c out <<" PAI D. . . PRESSENTERTO CONTI NUE" ; ge t c h( ) ; br e a k; } i f ( s t r c mp( s 1. f e e _s t a t , " PAI D" ) ==0) {c l r s c r ( ) ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" FEEI SALREADYPAI D" ; ge t c h( ) ; br e a k; } }
i f ( c ha nge . e of ( ) ) br e ak; } ge t c h( ) ; }
v oi dof f i c e _f unc t i on: : f e e _c he c k( ) {c l r s c r ( ) ; i ntpos ; f s t r e amf i l e ; f s t r e a mc ha ng e ; f i l e . ope n( " FEEDATE. da t " , i os : : i n| i os : : out ) ; c ha nge . ope n( " DATA. da t " , i os : : i n| i os : : out ) ; whi l e ( ! c ha nge . e of ( ) &&! f i l e . e of ( ) ) { f i l e . r e a d( ( c ha r * ) &f , s i z e of ( f ) ) ; i f ( f . day ==day &&f . mont h==mont h&&f . y ea r ==y ea r ) {
whi l e ( ! c ha nge . e of ( ) ) { i f ( c ha nge . e of ( ) ) br e a k; c ha nge . r e a d( ( c ha r * ) &s 1 , s i z eof ( s 1 ) ) ;
c o u t < < s 1 . p d a y ; i f ( s 1. pda y ==da y &&s 1. pmont h==mont h&&s 1. py e a r ) { c out <<" CHECKED" ; ge t c h( ) ; br e a k; } e l s e { s t r c py ( s 1 . f e e _ s t a t , " UNPAI D" ) ; c ha nge . s e e kp( c ha nge . t e l l g( )-s i z eof ( s 1 ) ) ; c ha nge . wr i t e ( ( c ha r * ) &s 1 ,s i z eof ( s 1 ) ) ; }
} ge t c h( ) ; } } c ha nge . c l os e ( ) ; f i l e . c l os e ( ) ; }
/ * Li br a r yI nt r o * / v oi dl i br a r y ( ) { c l r s c r ( ) ; c o u t < < " \ n \ n \ n " ; c out <<" \ t \ t WELCOMETO HOGWART' SBI BLI OTHEQUE \ n " ; c o ut < <" \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~\ n" ; g o t o x y ( 1 3 , 9 ) ; c out<<" HOGWARTSBI BLI OTHEQUE( HB)HASAWI DE ARRAYOF" ; g o t o x y ( 1 3 , 1 1 ) ; c out <<" NOVELS, REFERENCESAND OTHER KNOWLEDGESOURCES" ; g o t o x y ( 1 3 , 1 3 ) ; c out <<" HBI SWELLEQUI PPED LI BRARYWI TH EBOOK SERVI CES" ; g o t o x y ( 1 3 , 1 5 ) ; c out <<" THI SAPPLI CATI ONWI LLGUI DEYOUTOTHE LI BRARI AN' SDESK. " ; g o t o x y ( 2 7 , 2 1 ) ; c out <<" PRESSTO CONTI NUE. . . . . "; i f ( ge t c he ( ) ) { l i br . ma i nme nu( ) ; }
}
/ * f unc t i ont os howme nuf orl i br a r y * / v oi dl i bme nu: : ma i nme nu( ) { i ntl mc h; c l r s c r ( ) ; c o u t < < " \ n \ n " ; c out <<" \ t \ t \ t LIBRARY
\ n" ;
c o ut < <" \ t \ t \ t ~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 5 , 2 4 ) ; c out << "LI BRARI AN: VI SHNUPRASAD\ t \ t \ t \ t<0>f orEXI T" ; g o t o x y ( 3 0 , 7 ) ; c out <<" 1. I NTRODUCTI ON" ; g o t o x y ( 3 0 , 9 ) ; c out <<" 2. I SSUEBOOK"; g o t o x y ( 3 0 , 1 1 ) ; c out <<" 3. RETURNBOOK" ; g o t o x y ( 3 0 , 1 3 ) ; c out <<" 4. MEMBERS" ; g o t o x y ( 3 0 , 1 5 ) ; c out << " 5. BOOKS" ; g o t o x y ( 2 4 , 1 9 ) ;
c out <<" ENTERTHECHOI CE: " ; c i n>>l mc h; s wi t c h( l mc h) { c a s e1: l i br a r y ( ) ; br e a k; c a s e2: i s s ue ( ) ; br e a k; c a s e3: r e t u r n b o o k ( ) ; br e a k; c a s e4: me mopt ( ) ; br e a k; c a s e5: bookopt ( ) ; br e a k; c a s e0: i nt e r f a c e( ) ; br e a k ; de f a ul t : got ox y ( 30, 21) ; c out <<" WRONG CHOI CE" ; i f ( ge t c he ( ) ) { ma i nme nu( ) ; }
} } / * due da t ec a l c ul a t or * / v oi dl i bme nu: : due da t e ( i ntd1, i ntm1, i nty 1) { s t a t i ci ntmont h[ ]={ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; f or( i nti =1; i <=15; i ++) { d1++; i f( ( d1>mont h[ m11] )| |( y 1%4! =0&& m1==2&& d1>28) ) { d1=1; m1++; } i f( m1>12 ) { m1=1; y 1++; } } day=d1; mon=m1; y e a r=y 1; }
v oi dl i bme nu: : i s s ue ( ) { i ntt bc o de , t mc o de ; c ha rt mname [ 20] ; da t ed; g e t da t e ( &d) ; i ntda y=d. da _ da y; i ntmon=d. da_ mon; i nty e a r =d. da _y e a r; c l r s c r ( ) ; c o ut < <" Da t e : " <
\ n" ;
c o ut < <" \ t \ t \ t ~ ~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; got ox y ( 5, 8); c o ut< <" Ent e rCodeo ft heBoo kt obei s s ue d: "; c i n > > t b c o d e ; bl i s t . ope n( " bookl i s t . da t " , i os : : i n) ; whi l e ( ! bl i s t . e of ( ) ) { bl i s t . r e a d( ( c ha r * ) &book, s i z eof ( book) ) ; i f ( book. bc o de = =t bc o de ) { c o u t < < " \ n \ t " < < b o o k . bc o d e ; c o ut < <" \ t \ t " <
} bl i s t . c l os e ( ) ; g o t o x y ( 5 , 1 2 ) ; c out<<" Ent erCodeoft heMembert obei s s ued:"; c i n>>t mc ode; ml i s t . ope n( " me ml i s t . da t " , i os : : i n) ; whi l e ( ! ml i s t . e of ( ) ) { ml i s t . r e a d( ( c ha r * ) &me mbe r , s i z e of ( me mbe r ) ) ; i f ( me mber . mc ode ==t mc ode ) { { c out <<" \ n\ t " <>wc h; i f ( wc h==' y ' | | wc h==' Y' ) { i s s f i l e . ope n( " i s s de t . da t " , i os : : out | i os : : i n| i os : : a pp) ; i det . mc ode=t mc ode; s t r c p y ( i de t . mna me , t mna me ) ;
i de t . mbc o de = t b c ode ; i de t . i s s ue . da y =da y
;
i de t . i s s ue . mon =mon i de t . i s s ue . y e a r =y e a r
; ;
due da t e ( da y , mon, y e a r ); i de t . r e t da t . da y =l i br . da y ; i de t . r e t da t . mon =l i br . mon ; i de t . r e t da t . y ea r =l i br . y ea r; i s s f i l e . wr i t e ( ( c ha r * ) &i de t , s i z e of ( i de t ) ) ; i s s f i l e . c l os e( ) ; ma i nme nu( ) ; } e l s e { ma i nme nu( ) ; } }
/ * f unc t i ont or e t ur nbook * / v oi dl i bme nu: : r e t ur nbook( ) { l ongr pos; i ntr mcode; da t ed; g e t da t e ( &d) ; i ntda y=d. da _ da y;
i ntmon=d. da_ mon; i nty e a r =d. da _y e a r; c l r s c r ( ) ; c o ut < <" Da t e : " <
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~\ n" ; got ox y ( 5, 8); c out<<" Ent erCodeoft heMembert ober et ur n: "; c i n>>r mc ode; i s s f i l e . ope n( " i s s de t . da t " , i os : : i n| i os : : out ) ; whi l e ( ! i s s f i l e . e of ( ) ) { r pos =i s s f i l e . t e l l g( ) ; i s s f i l e . r e a d( ( c ha r * ) &i de t , s i z e of ( i de t ) ) ; i f ( i de t . mc o de = =r mc o de ) { got ox y ( 20, 10) ; c out <<" MEMBERCODE : " <
: " << i de t . mbc ode ;
got ox y ( 20, 13) ; c out <<" I SSUEDATE
:
" <
c out <<" REURNDATE
:
" <
=0;
s t r c py ( i de t . mna me , "" ); i de t . mbc o de
=0;
i de t . i s s ue . da y =0; i de t . i s s ue . mon =0; i de t . i s s ue . y e a r =0; i de t . r e t da t . da y =0; i de t . r e t da t . mon =0; i de t . r e t da t . y e a r =0; br e a k ; } } { i s s f i l e . s e e kg( r pos ) ; i s s f i l e . wr i t e ( ( c ha r * ) &i de t , s i z e of ( i de t ) ) ; i s s f i l e . c l os e( ) ; i f ( ge t c he ( ) ) ; ma i nme nu( ) ; } } / * f unc t i ont os howmemberopt i on * / v oi dl i bme nu: : me mopt ( )
{ i ntopt ; c l r s c r ( ) ; c o u t < < " \ n \ n " ; c out <<" \ t \ t \ t M EM BERS
\ n" ;
c o ut < <" \ t \ t \ t ~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~\ n" ; g o t o x y ( 6 0 , 2 4 ) ; c out <<"<0>f orEXI T" ; g o t o x y ( 3 0 , 9 ) ; c out <<" 1. VI EW MEMBERSLI ST"; g o t o x y ( 3 0 , 1 1 ) ; c out <<" 2. MEMBERSDETAI LS" ; g o t o x y ( 3 0 , 1 3 ) ; c out <<" 3. I SSUED DETAI LS" ; g o t o x y ( 2 4 , 1 8 ) ; c out <<" ENTERTHECHOI CE: " ; c i n > > o p t ; s wi t c h( opt ) { c a s e1: { me ml i s t ( ) ; br e a k; } c a s e2: mde t a i l s ( ); br e a k; c a s e3:
i s s ue de t ( ) ; br e a k; c a s e0: l i br a r y ( ) ; br e a k ; de f a ul t : got ox y ( 30, 21) ; c out <<" WRONG CHOI CE" ; i f ( ge t c he ( ) ) { me mopt ( ) ; } } } / * f unc t i ont os howbo okopt i on * / v oi dl i bme nu: : me ml i s t ( ) { c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<"LIST O FM EM BERS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; c out <<" \ n\ n\ n" ; c out <<" \ n CO D E
NAM E
CLASS
CO NTACT
" ; c o ut < <" " ; ml i s t . ope n( " me ml i s t . da t " , i os : : i n); ml i s t . s e e kg( 0) ; i ntr =10; whi l e ( 1) { ml i s t . r e a d( ( c ha r * ) &me mbe r , s i z e of ( me mbe r ) ) ; i f ( ml i s t . e of ( ) ) { br e a k ; } f or ( i nti =0; i <100; i ++) { i f ( member . mcode==i ) { got ox y ( 7 , r ) ; c out <
} } c out <<" \ n\ n\ n\ n\ t \ t \ t \ t PRESSANYKEY. . . " ; ml i s t . c l os e ( ) ; i f ( ge t c he ( ) ) { me mopt ( ) ; } } / * f unc t i ont os howme mb e r de t a i l s * / v oi dl i bme nu: : mde t a i l s ( ) { c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<"M EM BERSD ETAILS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; i ntmdet c ode; c out <<" \ n\ n\ n\ t \ t ENTERAMEMBERCODE: " ; ci n>>mdet c ode; ml i s t . ope n( " me ml i s t . da t " , i os : : i n); whi l e ( ! ml i s t . e of ( ) ) { ml i s t . r e a d( ( c ha r * ) &me mbe r , s i z e of ( me mbe r ) ) ; i f ( me mber . mc ode ==mdet c ode )
{ got ox y ( 26, 10) ; c out << " CODE
: " << me mbe r . mc ode ;
got ox y ( 26, 12) ; c out << " NAME
: " ;
put s ( me mber . mna me ) ; got ox y ( 26, 14) ; c out <<" CLASS : " ; c out <
/ * FUNCTI ONTO SHOW I SSUEDETAI LS * / v oi dl i bme nu: : i s s ue de t ( ) {
c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<"ISSUE D ETAILS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; i nti s s c ode , f ound=0; c out <<" \ n\ n\ n\ t \ t ENTERAMEMBERCODE: " ; c i n>>i s s c ode ; got ox y ( 12, 18) ; c out <<" I fr e t ur nda t ea ndI s s ueda t ea r eze r ot her e c or di sl a s ti s s ue d" ; i s s f i l e . ope n( " i s s de t . da t " , i os : : i n) ; whi l e ( ! i s s f i l e . e of ( ) ) { i s s f i l e . r e a d( ( c ha r * ) &i de t , s i z e of ( i de t ) ) ; i f ( i de t . mc ode ==i s s c ode ) { f ound=1; got ox y ( 26, 10) ; c out <<" MEMBERCODE
: " <
got ox y ( 26, 12) ; c out <<" MEMBERNAME
: " ;
p ut s ( i de t . mna me ) ; got ox y ( 26, 14) ; c out <<" BOOK
: " <
got ox y ( 26, 15) ; c out <<" I SSUE DATE
:
" <
:
" <
BO O KS
\ n" ;
c o ut < <" \ t \ t \ t ~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ \ n" ; g o t o x y ( 6 0 , 2 4 ) ;
c out <<"<0>f orEXI T" ; g o t o x y ( 3 0 , 8 ) ; c out <<" 1. ADD BOOK" ; g o t o x y ( 3 0 , 1 0 ) ; c out <<" 2. VI EW BOOKLI ST"; g o t o x y ( 3 0 , 1 2 ) ; c out <<" 3. BOOKDETAI LS" ; g o t o x y ( 3 0 , 1 4 ) ; c out << " 4. MODI FY" ; g o t o x y ( 2 4 , 1 9 ) ; c out <<" ENTERTHECHOI CE: " ; c i n > > o p t ; s wi t c h( opt ) { c a s e1: a d d b o o k s ( ) ; br e a k; c a s e2: bookl i s t ( ) ; br e a k; c a s e3: bde t a i l s ( ) ; br e a k; c a s e4: bmodi f y ( ) ; br e a k; c a s e0: l i br a r y ( ) ; br e a k ;
de f a ul t : got ox y ( 30, 21) ; c out <<" WRONG CHOI CE" ; i f ( ge t c he ( ) ) { c l r s c r ( ) ; bookopt ( ) ; } } } / * f unc t i ont oa d db oo ks * / v oi dl i bme nu: : a ddbooks ( ) { i nts i z e ; bl i s t . ope n( " bookl i s t . da t " , i os : : out | i os : : i n| i os : : a t e ); bl i s t . s e ekg( 0, i os : : e nd) ; l ongpos =bl i s t . t e l l g( ) ; s i z e=s i z eof ( book) ; bl i s t . c l os e ( ) ; c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<" AD D BO O KS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~" ; book. bcode++;
got ox y ( 26, 7) ; c out << " CODE
: " ;
got ox y ( 26, 9) ; c out << " NAME
: " ;
got ox y ( 26, 11) ; c out <<" AUTHOR : " ; got ox y ( 26, 13) ; c out <<" PUBLI CATI ON: " ; got ox y ( 26, 15) ; c out <<" NO OFCOPI ES: " ; got ox y ( 26, 17) ; c out <<" PRI CE
: Rs . " ;
got ox y ( 45, 7) ; book. bc ode =( pos / s i z e ) +1; c out < >book. c o pi e s ; got ox y ( 45, 17) ; c i n>>book. pr i c e ; c harwc h; got ox y ( 30, 20) ; c out <<" WANTTO SAVE( y / n): " ; c i n>>wc h;
i f ( wc h==' y ' | | wc h==' Y' ) { wr i t e book( ) ; book. bc ode ++; } e l s e { bookopt ( ) ; } } / * wr i t ebookt of i l e * / v oi dl i bme nu: : wr i t e book( ) { bl i s t . ope n( " bookl i s t . da t " , i os : : out | i os : : i n| i os : : a t e ); bl i s t . wr i t e ( ( c ha r * ) &book, s i z eof ( book) ) ; bl i s t . c l os e ( ) ; b ookopt ( ) ; }
/ * f unc t i ont os howbookl i s t * /
voi dl i bme nu: : bookl i s t ( ) { c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<"LIST O FBO O KS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; c out <<" \ n\ n\ n" ; c out <<" \ nCO D E
NAM E
AUTH O R
PUBLISH E
R" ; c o ut < <" " ; bl i s t . ope n( " bookl i s t . da t " , i os : : i n); bl i s t . s e ekg( 0) ; i ntr =10; whi l e ( 1) { bl i s t . r e a d( ( c ha r * ) &book, s i z e of ( book) ) ; i f ( bl i s t . e of ( ) ) { br e a k ; } f or ( i nti =0; i <100; i ++) { i f ( book. bc ode ==i ) {
got ox y ( 5 , r ) ; cout < 0) { got ox y ( 63, r ) ; c out <<" St a t us : Av ai l " ; } e l s e { got ox y ( 63, r ) ; c o ut < <" St a t us : N/ A" ; } r =r +2; } } } c out <<" \ n\ n\ n\ n\ t \ t \ t \ t Pr e s sa nyke y. . . " ; bl i s t . c l os e ( ) ; i f ( ge t c he ( ) ) { bookopt ( ) ;
} } / * f unc t i ont os howbookde t a i l s * / v oi dl i bme nu: : bde t a i l s ( ) { c l r s c r ( ) ; got ox y ( 28, 3) ; c out <<"BO O KSD ETAILS" ; got ox y ( 28, 4) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; i ntbde t c o de ; c out <<" \ n\ n\ n\ t \ t ENTERABOOKCODE: " ; c i n> >bde t c o de ; bl i s t . ope n( " bookl i s t . da t " , i os : : i n); whi l e ( ! bl i s t . e of ( ) ) { bl i s t . r e a d( ( c ha r * ) &book, s i z e of ( book) ) ; i f ( b o o k . b c o d e = = b d e t c o d e ) { got ox y ( 26, 10) ; c out <<" CODE
: " <
got ox y ( 26, 12) ; c out << " NAME
: " ;
put s ( boo k. bna me ) ; got ox y ( 26, 14) ;
c out <<" AUTHOR : " ; put s ( book. a ut h) ; got ox y ( 26, 16) ; c out <<" PUBLI CATI ON: " ; put s ( book. publ ) ; got ox y ( 26, 18) ; c out << " NO OFCOPI ES:" << book. c opi e s ; got ox y ( 26, 20) ; c out <<" PRI CE
: " <
i f ( book. c opi e s > 0) { g o t o x y ( 2 6 , 2 2 ) ; c out <<" STATUS : Ava i l " ; } e l s e { g o t o x y ( 2 6 , 2 2 ) ; c out << " STATUS : N/ A" ; } } } bl i s t . c l os e ( ) ; i f ( ge t c he ( ) ) { bookopt ( ) ; }
} / * Modi f yabook * / v oi dl i bme nu: : bmodi f y ( ) { c ha rnewbname [ 30] ; c ha rne wa ut h[ 3 0] ; c ha rne wpubl[ 8 0 ] ; i ntne wc o pi e s ; i ntne wpr i c e; c l r s c r ( ) ; bl i s t . ope n( " bookl i s t . da t " , i os : : i n| i os : : out | i os : : bi na r y ) ; l ongc ur pos ; g o t o x y ( 2 8 , 3 ) ; c out <<" M O D IFY BO O KS" ; g o t o x y ( 2 6 , 4 ) ; cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~"; i ntmodc ode; c out <<" \ n\ n\ n\ t \ t ENTERABOOKCODE: " ; c i n>>modcode ; whi l e ( ! bl i s t . e of ( ) ) {c ur pos =bl i s t . t e l l g( ) ; bl i s t . r e a d( ( c ha r * ) &book, s i z e of ( book) ) ; i f ( book. bcode==modc ode) { g o t o x y ( 1 2 , 1 0 ) ; c out <<" CODE got ox y ( 12, 12) ;
: " <
c out << " NAME
: " ;
put s ( b oo k. bna me ) ; got ox y ( 12, 14) ; c out <<" AUTHOR : " ; put s ( book. a ut h) ; got ox y ( 12, 16) ; c out <<" PUBLI CATI ON: " ; put s ( book. publ ) ; got ox y ( 12, 18) ; c out << " NO OFCOPI ES:" << book. c opi e s ; got ox y ( 12, 20) ; c out <<" PRI CE
: Rs . " <
got ox y ( 20, 23) ; c out <<" Re t y pet or e t a i nt hev al ue s " ; got ox y ( 46, 12) ; get s ( newbname) ; got ox y ( 46, 14) ; g e t s ( ne wa ut h) ; got ox y ( 46, 16) ; g e t s ( ne wpubl ) ; got ox y ( 46, 18) ; c i n> >ne wc o pi e s ; got ox y ( 46, 20) ; c i n> >ne wpr i c e ; s t r c py( book. bname, newbname) ; s t r c py ( book. a ut h, ne wa ut h) ; s t r c py ( book. publ , ne wpubl ) ;
b oo k. c o pi e s = ne wc o pi e s ; boo k. pr i c e = ne wpr i c e ; br e a k; } } { bl i s t . s e e kg( c ur pos ) ; bl i s t . wr i t e ( ( c ha r * ) &book, s i z eof ( book) ) ; bl i s t . c l os e ( ) ; b ookopt ( ) ; } } / * LABS * / v oi dl a bs ( ) { i ntc h; whi l e ( 1) { c l r s c r ( ) ; g o t o x y ( 3 2 , 2 ) ; c out <<"CHOOSEALABORATORY" ; g o t o x y ( 2 0 , 8 ) ; c out <<"1. PHYSI CSLABORATORY" ; g o t o x y ( 2 0 , 1 1 ) ; c out <<"2. CHEMI STRYLABORATORY" ; g o t o x y ( 2 0 , 1 4 ) ;
c out <<"3. COMPUTERLABORATORY" ; g o t o x y ( 2 0 , 1 7 ) ; c out <<"4. BI OLOGYLABORATORY" ; g o t o x y ( 7 0 , 2 5 ) ; c out <<"0. EXI T" ; g o t o x y ( 1 0 , 4 ) ; c out <<"CHOOSEYOURCHOI CE: -" ; c i n > > c h ; s wi t c h( c h) { c a s e1: p h y l a b ( ) ; br e a k; c a s e2: c he ml a b ( ) ; br e a k; c a s e3: c o mpl a b ( ) ; br e a k; c a s e4: bi ol a b( ) ; br e a k; c a s e0: e x i t ( 0 ) ;
d e f a u l t : c out <<" ENTERAVALI D CHOI CE" ; } ge t c h( ) ; } }
/ * PHYSI CSLAB * / v oi dphy l a b( ) { i ntc h; c out <<"WELCOMETO PHYSI CSLABORATORY" ; whi l e ( 1) { c l r s c r ( ) ; g o t o x y ( 2 0 , 8 ) ; c out <<" 1. ENTERNEW I NSTRUMENTS" ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" 2. DI SPALYI NSTRUMENTS" ; g o t o x y ( 2 0 , 1 4 ) ; c out <<" 0. GO BACK" ; g o t o x y ( 1 5 , 5 ) ; ; c out <<" ENTERACHOI CE: -" ;
c i n > > c h ; s wi t c h( c h) { c a s e1: W. Add_i ns t ( 1) ; br e a k; c a s e2: W. Show_i ns t ( 1) ; br e a k;
c a s e0: l a bs ( ) ; d e f a u l t : c out <<" ENTERAVALI D CHOI CE" ; } g e t c h ( ) ; } } / * CHEMI STRYLAB * / v oi dc he ml a b( ) { i ntc h, n; c out <<" ~~~~~~~~W ELCO M E TO CH EM ISTRY L
AB~~~~~~~~" ; whi l e ( 1) {
c l r s c r ( ) ; g o t o x y ( 2 0 , 8 ) ; c out <<" 1. ADD ANEW CHEMI CAL" ;
got ox y ( 20, 10) ; c out <<" 2. ADD AACCESSORY" ; g o t o x y ( 2 0 , 1 2 ) ; c out <<" 3. SHOW AVAI LABLECHEMI CAL" ;
got ox y ( 20, 14) ; c out <<" 4. CHEMI CALDETAI LS" ; g o t o x y ( 2 0 , 1 6 ) ; c out <<" 5. I NSTRUMENTSDETAI LS" ;
got ox y ( 20, 18) ; c out << " 6. MODI FY" ; g o t o x y ( 2 0 , 2 0 ) ; c out <<" 0. BACK" ;
g ot ox y ( 15, 5) ; c out <<" ENTERACHOI CE: -" ; c i n > > c h ;
s wi t c h( c h) { c a s e1: W. Add_Chemi c a l ( ) ;
br e a k ; c a s e2: W. Add_i ns t ( 2) ;
br e a k ; c a s e3: W. Av a i l a bl e _ c he mi c a l s ( ) ;
br e a k ; c a s e4: W. Show_ c he mi c a l _ de t a i l ( ) ;
br e a k ; c a s e5: W. Show_i ns t ( 2) ;
br e a k ; c a s e6: W. Modi f y _Che mi c al ( ) ;
br e a k ; c a s e0: l a bs ( ) ;
de f a ul t : c out <<" ENTERAVALI D CHOI CE" ; }
ge t c h( ) ; } }
/ * COMPUTERLAB * / v oi dc ompl a b( ) { i ntc h, n; c out <<" WELCOMETO COMPUTERLABORATORY" ; whi l e ( 1) { c l r s c r ( ) ; g o t o x y ( 2 0 , 8 ) ; c out <<" 1. ADD ANEW SYSTEM" ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" 2. ADD AACCESSORY" ; g o t o x y ( 2 0 , 1 2 ) ; c out <<" 3. SHOW AVAI LABLESYSTEM" ; g o t o x y ( 2 0 , 1 4 ) ; c out <<" 4. SYSTEM DETAI LS" ; g o t o x y ( 2 0 , 1 6 ) ; c out <<" 5. I NSTRUMENTSDETAI LS" ; g o t o x y ( 2 0 , 1 8 ) ; c out << " 6. MODI FY" ; g o t o x y ( 2 0 , 2 0 ) ; c out <<" 0. BACK" ; g o t o x y ( 1 5 , 5 ) ; c out <<" ENTERACHOI SE: -" ; c i n > > c h ; s wi t c h( c h) {
c a s e1: W. Add_s y s t e m( ) ; br e a k ; c a s e2: W. Add_i ns t ( 3) ; br e a k ; c a s e3: W. Sy s t e m_ pr e s e nt ( ) ; br e a k ; c a s e4: W. Show_ s y s t e m_ de t a i l ( ) ; br e a k ; c a s e5: W. Show_i ns t ( 3) ; br e a k ; c a s e6: W. Modi f y _s ys t em( ) ; br e a k ; c a s e0: l a bs ( ) ; d e f a u l t :
c out <<" ENTERAVALI D CHOI CE" ; } ge t c h( ) ; } } / * BI OLOGYLAB * / v o i dbi ol a b ( )/ / Bi ol oyLa bMe nu { i ntn, c h; c out <<"WELCOMETO BI OLOGYLABORATORY" ; whi l e ( 1) { c l r s c r ( ) ; g o t o x y ( 2 0 , 8 ) ; c out <<" 1. ADD ANEW SPECI MEN" ; g o t o x y ( 2 0 , 1 0 ) ; c out <<" 2. ADD AI NSTRUMENT" ; g o t o x y ( 2 0 , 1 2 ) ; c out <<" 3. SHOW AVAI LABLESPECI MEN" ; g o t o x y ( 2 0 , 1 4 ) ; c out <<" 4. SPECI MENDETAI LS" ; g o t o x y ( 2 0 , 1 6 ) ; c out <<" 5. I NSTRUMENTSDETAI LS" ; g o t o x y ( 2 0 , 1 8 ) ; c out << " 6. MODI FY" ; g o t o x y ( 2 0 , 2 0 ) ;
c out <<" 0. BACK" ; g o t o x y ( 1 5 , 5 ) ; c out <<" ENTERACHOI CE: -" ; c i n > > c h ; s wi t c h( c h) { c a s e1: W. Add_s pe c ( ); br e a k; c a s e2: W. Add_i ns t ( 4) ; br e a k; c a s e3: W. Av a i l a bl e _s pe c i me n( ) ; br e a k; c a s e4: W. Show_s pe c _de t a i l s ( ); br e a k; c a s e5: W. Show_i ns t ( 4) ; br e a k; c a s e6: W. Modi f y _s pe c i me n( ) ;
br e a k; c a s e0: l a bs ( ) ;
d e f a u l t : c out <<" ENTERAVALI D CHOI CE" ; } g e t c h ( ) ; } } / * SI ZEOFCHEMI STRYLAB * / i ntWor ki ng: : s i z e of _ c he m( ) { i f s t r e amf i n; i ntno; f i n. ope n( " Che mi c a l . da t " , i os : : i n) ; f i n. s e ekg( 0, i os : : e nd) ; l ongpos = f i n. t e l l g( ) ; no= pos / s i z e o f ( c he m) ; no++ ; f i n. c l os e ( ) ; r e t ur nno; } / * -
ADD CHEMI CALS * / v oi dWor ki ng: : Add_Che mi c a l ( ) { c l r s c r ( ) ; of s t r e a mf o; f o. ope n( " Che mi c a l . da t " , i os : : out | i os : : a pp) ; c out <<" \ n\ t \ t AD D CH EM ICAL
" ;
c o ut < <" \ n\ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~\ n" ; whi l e ( 1) { chem. Sno=s i ze of _chem( ) ;
g ot ox y ( 25, 5) ; c out <<" SERI ALNUMBER : " ;
g ot ox y ( 25, 6) ; c out <<" CHEMI CALNAME : " ;
g ot ox y ( 25, 7) ; c o ut < <" v ol ume
: " ;
g ot ox y ( 25, 8) ; c out <<" CONCENTRATI ON : " ;
g ot ox y ( 25, 9) ; c out <<" DATEOFEXPI TY: " ;
got ox y ( 25, 10) ; c out <<" NUMBEROFI TEMS: " ;
g ot ox y ( 43, 5) ; c out <
g ot ox y ( 43, 6) ;
get s ( c hem. Name) ;
g ot ox y ( 43, 7) ;
ci n>>chem. Vol ;
g ot ox y ( 43, 8) ; c i n>>c hem. Conc ;
g ot ox y ( 43, 9) ;
g e t s ( c hem. DOE) ;
got ox y ( 43, 10) ; c i n>>c hem. Nos ; f o . wr i t e ( ( c ha r * ) &c he m, s i z e of ( c he m) ) ; c out <<" \ n\ n\ n\ t \ t \ t ~~~~SAVI NG~~~~" ;
br e a k ; }
f o. c l os e ( ) ; } / * AVAI LABLECHEMI CALS * / v oi dWor ki ng: : Av a i l a bl e _c he mi c a l s ( ) { c l r s c r ( ) ; f s t r e a mf i n; g ot ox y ( 28, 4) ; c out <<"CH EM ICAL PRESENT" ; g ot ox y ( 25, 5) ; cout <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; c out <<" \ n\ n\ n-
" ; c out <<"\ nS. NO
NAM E
CO NC.
" ;
c out <<" " ; f i n. ope n( " Che mi c a l . da t " , i os : : i n) ; f i n. s e e kg( 0) ; i ntr =12; whi l e ( 1) { f i n. r e a d( ( c ha r * ) &c he m, s i z e of ( c he m) ) ; i f ( f i n. e of ( ) )
br e a k ; got ox y ( 5, r ) ; c out <
got ox y ( 28, r ) ; c out << c hem. Na me ;
got ox y ( 57, r ) ;
c out <
r = r + 2; }
c out <<" \ n\ n\ n\ n\ t \ t \ t \ t Pr e s sa nyke y. . . " ; f i n. c l os e ( ) ; } / * CHEMI CALSDETAI LS * /
v oi dWor ki ng: : Show_c he mi c a l _de t a i l ( ) { c l r s c r ( ) ; i ntn; c o u t < < " \ n " ; c out <<" \ t \ t \ t CH EM ICAL D ETAIL
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ \ n" ; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n > > n ; i f s t r e amf i n; f i n. ope n( " Che mi c a l . da t " , i os : : i n) ; f i n. s e e kg( 0) ; whi l e ( ! f i n. e of ( ) ) { f i n. r e a d( ( c ha r * ) &pc , s i z eof ( pc ) ) ; i f ( chem. Sno==n) {
g ot ox y ( 30, 8) ; c out << " SERI ALNO
: " << c he m. Sno;
g o t o x y ( 3 0 , 9 ) ; c out <<" CHEMI CALNAME : " <
: " << c he m. Vol ;
g o t o x y ( 3 0 , 1 2 ) ; c out <<" DATEOFEXPI RY : " <
c out <<" NUMBEROFI TEMS: " <
\ n" ;
c o ut < <" \ t \ t \ t~ ~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ \ n" ; i ntmodc ode; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n>>modcode ; whi l e ( ! s y s . e of ( ) ) {
c ur pos =s y s . t e l l g( ) ; s y s . r e a d( ( c ha r * ) &c he m, s i z e of ( c he m) ) ; i f ( c he m. Sno==modc ode ) { g ot ox y ( 20, 8) ; c out << " SERI ALNO
: " << c he m. Sno;
g o t o x y ( 2 0 , 9 ) ; c out <<" CHEMI CALNAME
: " <
g o t o x y ( 2 0 , 1 0 ) ; c out <<" CONCENTRATI ON
: " <
g o t o x y ( 2 0 , 1 1 ) ; c out << " VOLUME(I NLI TRES): " <
got ox y ( 15, 20) ; c out <<" ENTER' . ' TO RETAI NTHEVALUESOFCHARACTER" ; g o t o x y ( 1 5 , 2 1 ) ; c out <<" RETYPETHENUMBERTO RETAI N" ;
g ot ox y ( 55, 9) ;
get s ( newc name) ; got ox y ( 55, 10) ; c i n>>newc onc ; got ox y ( 55, 11) ; ci n>>newvol; g o t o x y ( 5 5 , 1 2 ) ;
ge t s ( newDOE) ;
got ox y ( 55, 13) ;
ci n>>newnos ; i f ( s t r c mp( ne wc na me , " . " ) ! =0) s t r c py ( c he m. Name , newc name ) ;
i f ( s t r c mp( ne wDOE, " . " ) ! = 0)
s t r c py ( c he m. DOE, newDOE) ; c hem. Nos =ne wnos ;
c hem. Conc =ne wc onc ; c he m. Vol =newvol ; br e a k; } } s y s . s e e kg( c ur pos ) ; s y s . wr i t e ( ( c ha r * ) &c he m, s i z e of ( c he m) ) ; s y s . c l os e ( ) ;
} / * SI ZEOFSYSTEM * / i ntWor ki ng: : s i z e of _s y s t e m( ) { i f s t r e amf i n; i ntno; f i n. ope n( " s y s t e m_pc . da t " , i os : : i n) ; f i n. s e ekg( 0, i os : : e nd) ; l ongpos = f i n. t e l l g( ) ; no=pos / s i z e of ( pc ) ;
no++ ; f i n. c l os e ( ) ; r e t ur nno; } v oi dWor ki ng: : Add_s y s t e m( )/ / Toa ddt hev a l ue sofNe w_s y s t e m { c l r s c r ( ) ; i ntn; c ha rc h; of s t r e a mf o; f o. ope n( " s y s t e m_pc . da t " , i os : : out | i os : : a pp) ; c out << " \ n\ t \ t ADD SYSEM " ; c o ut < <" \ n\ t \ t~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ \ n" ; whi l e ( 1) { pc . no=s i z e of _s y s t e m( ) ; g ot ox y ( 25, 5) ; c out <<" SERI ALNUMBER : " ; got ox y ( 25, 6) ; c out <<" PROCESSOR
: " ;
g ot ox y ( 25, 7) ; c out <<" OPERATI NG SYSTEM : " ; got ox y ( 25, 8) ; c out <<" COMPANY
: " ;
g ot ox y ( 25, 9) ; c out <<" HARD DI SK( I NGB): " ; got ox y ( 25, 10) ; c out <<" R. A. M (i nGB) : " ;
got ox y ( 25, 11) ; c out <<" COST( I NRS) : " ; got ox y ( 43, 5) ; c o ut < >pc . mr y ; got ox y ( 43, 10) ; c i n> >pc . r a m; got ox y ( 43, 11) ; c i n>>pc . c os t ; f o. wr i t e ( ( c ha r * ) &pc , s i z eof ( pc ) ) ; c out <<" \ n\ n\ n\ t \ t \ t ~~~~SAVI NG~~~~" ; br e a k ; } f o. c l os e ( ) ; } / * SYSTEM( S)PRESENT * / v oi dWor ki ng: : Sy s t e m_pr e s e nt ( )
{ c l r s c r ( ) ; f s t r e a mf i n; g ot ox y ( 28, 4) ; c out <<"SYSTEM PRESENT" ; got ox y ( 25, 5) ; c out <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; c out <<" \ n\ n\ n" ; c out <<" \ nS. NO
CO M PANY
OS
" ;
c out <<" " ; f i n. ope n( " s y s t e m_pc . da t " , i os : : i n) ; f i n. s e e kg( 0) ; i ntr =12; whi l e ( 1) { f i n. r e a d( ( c ha r * ) &pc , s i z eof ( pc ) ) ; i f ( f i n. e of ( ) ) br e a k;
got ox y ( 5, r ) ;
c o ut <
cout <
got ox y ( 57, r ) ;
c out <
r =r +2 ; } c out <<" \ n\ n\ n\ n\ t \ t \ t \ t PRESSANYKEY. . . " ; f i n. c l os e ( ) ; ge t c h( ) ; c o mpl a b ( ) ; } / * SYSTEM DETAI LS * / v oi dWor ki ng: : Show_s y s t e m_de t a i l ( )/ / Todi s pl a yt hev a l ueofNe w_s y s t e m { c l r s c r ( ) ; i ntn; c o u t < < " \ n " ; c out <<" \ t \ t \ t CH EM ICAL D ETAIL
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ \ n" ; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n > > n ; i f s t r e amf i n; f i n. ope n( " s y s t e m_pc . da t " , i os : : i n) ; f i n. s e e kg( 0) ; whi l e ( ! f i n. e of ( ) ) { f i n. r e a d( ( c ha r * ) &pc , s i z eof ( pc ) ) ; i f ( p c . n o = = n )
{
g ot ox y ( 30, 8) ; c out << " SERI ALNO
: " << pc . no;
g o t o x y ( 3 0 , 9 ) ; c out << " PROCESSOR
: " << pc . pr c s ;
g o t o x y ( 3 0 , 1 0 ) ; c out <<" OPERATI NG SYSTEM : " <
: " << pc . c mpy ;
g o t o x y ( 3 0 , 1 2 ) ; c out << " HARD DI SK(I NGB): " << pc . mr y ; g o t o x y ( 3 0 , 1 3 ) ; c out <<" R. A. Mi nGB ) : " <
br e a k ; } } f i n. c l os e ( ) ;
} / * MODI FYSYSTEM * / v oi dWor ki ng: : Modi f y _s y s t e m( ) { c l r s c r ( ) ; i ntnewmr y , newr am, newc os t ;
c ha rne wpr c s [ 3 0] , ne wos [ 3 0] , ne wc mpy [ 3 0 ] ; f s t r e a ms y s ; s y s . ope n( " s y s t e m_pc . da t " , i os : : i n| i os : : out | i os : : bi na r y) ; l ongc ur pos ; c o u t < < " \ n " ; c out << " \ t \ t \ t M O DIFY SYSTEM
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ \ n" ; i ntmodc ode; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n>>modcode ; whi l e ( ! s y s . e of ( ) ) { c ur pos = s y s . t e l l g( ) ; s y s . r e a d( ( c ha r * ) &pc , s i z eof ( pc ) ) ; i f ( pc . no= =mo dc o de ) { g ot ox y ( 20, 8) ; c out << " SERI ALNO
: " << pc . no;
g o t o x y ( 2 0 , 9 ) ; c out << " PROCESSOR
: " << pc . pr c s ;
g o t o x y ( 2 0 , 1 0 ) ; c out <<" OPERATI NG SYSTEM : " <
: " << pc . c mpy ;
g o t o x y ( 2 0 , 1 2 ) ; c out << " HARD DI SK(I NGB): " << pc . mr y ; g o t o x y ( 2 0 , 1 3 ) ;
c out <<" R. A. M (i nGB ) : " <
got ox y ( 15, 20) ; c out <<" ENTER' . ' TO RETAI NTHEVALUESOFCHARACTER" ; g o t o x y ( 1 5 , 2 1 ) ; c out <<" RETYPETHENUMBERTO RETAI N" ;
g ot ox y ( 55, 9) ;
g e t s ( ne wpr c s ) ; g o t o x y ( 5 5 , 1 0 ) ;
g e t s ( ne wos ) ;
got ox y ( 55, 11) ;
get s ( newcmpy) ; g o t o x y ( 5 5 , 1 2 ) ;
c i n>>ne wmr y ;
got ox y ( 55, 13) ;
c i n>>newr am; g o t o x y ( 5 5 , 1 4 ) ;
c i n> >ne wc o s t ; i f ( s t r c mp( ne wpr c s , " . " ) ! =0) s t r c py ( pc . pr c s , ne wpr c s ) ; i f ( s t r c mp( ne wos , " . " ) ! =0)
s t r c py ( pc . os , ne wos ) ; i f ( s t r c mp( ne wc mpy , " . " ) ! =0) s t r c py ( pc . c mpy , ne wc mpy ) ; pc . mr y =ne wmr y ;
pc . r a m=newr a m;
pc . c o s t = ne wc o s t ; br e a k;
} } s y s . s e e kg( c ur pos ) ; s y s . wr i t e ( ( c ha r * ) &pc , s i z eof ( pc ) ) ; s y s . c l os e ( ) ; c o mpl a b ( ) ; } / * SI ZEOFI NSTRUMENTS * / i ntWor ki ng: : s i z eof _i ns t ( i ntn) { i f s t r e amf i n; i ntno; i f ( n==1) f i n. ope n( " phy _i ns t . da t " , i os : : i n) ; i f ( n==2) f i n. ope n( " c he m_i ns t . da t " , i os : : i n) ; i f ( n==3) f i n. ope n( " c omp_i ns t . da t " , i os : : i n) ; i f ( n==4) f i n. ope n( " bi o_i ns t . da t " , i os : : i n) ; f i n. s e e kg( 0, i os : : e nd) ; l ongpos = f i n. t e l l g( ) ; no=pos / s i z eof ( I ns t ) ; no++ ; f i n. c l os e ( ) ;
r e t ur nno; } / * ADD I NSTRUMENTS * / v oi dWor ki ng: : Add_i ns t ( i ntn) / /Toa ddne wi ns t r ume nt s / a c c e s s or i e s { c l r s c r ( ) ; c ha rc h; of s t r e a mf o; c out <<" \ n\ t \ t ADD INSTRUM ENTS " ; c o ut < <" \ n\ t \ t~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ \ n" ; i f ( n==1)
f o . ope n( " phy _i ns t . da t " , i os : : out | i os : : a pp) ;
i f ( n==2) f o. ope n( " c he m_i ns t . da t " , i os : : out | i os : : a pp) ; i f ( n==3)
f o. ope n( " c omp_i ns t . da t " , i os : : out | i os : : a pp) ;
i f ( n==4) f o. ope n( " bi o_i ns t . da t " , i os : : out | i os : : a pp) ; whi l e ( 1) {
I ns t . Sno=s i z eof _i ns t ( n) ; g o t o x y ( 2 5 , 5 ) ; c out <<" SERI ALNUMBER : " ;
g ot ox y ( 25, 6) ;
c out <<" TYPE
: " ; g o t o x y ( 2 5 , 7 ) ;
c out << " NAME
: " ;
g ot ox y ( 25, 8) ; c out <<" COMPANY
: " ;
g o t o x y ( 2 5 , 9 ) ; c out <<" NUMBEROFI TEMS: " ;
got ox y ( 25, 10) ; c out <<" COST(i nRs ): " ; g o t o x y ( 4 3 , 5 ) ;
c o ut <
g ot ox y ( 43, 6) ;
g et s ( I ns t . t y pe ) ; g o t o x y ( 4 3 , 7 ) ; ge t s ( I ns t . na me _i ns t ) ;
g ot ox y ( 43, 8) ; g e t s ( I ns t . c ompa ny ) ; got ox y ( 43, 9) ; c i n> >I ns t . numb_ i ns t;
got ox y ( 43, 10) ; c i n>>I ns t . c os t ; f o. wr i t e ( ( c ha r * ) &I ns t , s i z e of ( I ns t ) ) ; c o ut < <" \ n\ n\ n\ t \ t \ t ~ ~~ ~Sa v i ng ~~ ~~ " ;
br e a k ; } f o. c l os e ( ) ; }
/ * I NSTRUMENTSDETI LS * / v oi dWor ki ng: : Show_i ns t ( i ntn) / / Todi s pl a yt hev a l ue sofi ns t r ume nt s/ a c c e s s o r i e s { c l r s c r ( ) ; c ha rc h; i f s t r e amf i n; i f ( n = = 1 ) f i n. ope n( " phy _i ns t . da t " , i os : : i n, i os : : a pp) ; i f ( n = = 2 ) f i n. ope n( " c he m_i ns t . da t " , i os : : i n, i os : : a pp) ; i f ( n = = 3 ) f i n. ope n( " c omp_i ns t . da t " , i os : : i n, i os : : a pp) ; i f ( n = = 4 ) f i n. ope n( " bi o_i ns t . da t " , i os : : i n, i os : : a pp) ; i ntm; c o u t < < " \ n " ; c out <<" \ t \ t \ t INSTRUM ENTSD ETAILS \ n" ; c o ut < <" \ t \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~\ n" ; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n>>m; f i n. s e e kg( 0) ; whi l e ( ! f i n. e of ( ) ) { f i n. r e ad( ( c ha r * ) &I ns t , s i z e of ( I ns t ) ) ; i f ( I ns t . Sno= =m)
{ c l r s c r ( ) ; got ox y ( 30, 8) ; c out <<" SERI ALNO
: " <
g o t o x y ( 3 0 , 9 ) ; c o ut < <" TYPE
: " <
g o t o x y ( 3 0 , 1 0 ) ; c out <<" NAME
: " <
g o t o x y ( 3 0 , 1 1 ) ; c out << " COMPANY
: " << I ns t . c ompa ny;
g o t o x y ( 3 0 , 1 2 ) ; c out <<" NUMBEROFI TEMS : " <
f i n. c l os e ( ) ; r e t ur nno; } / * ADD SPECI MEN * / v oi dWor ki ng: : Add_s pe c ( ) { c l r s c r ( ) ; c out <<" \ n\ t \ t AD D SPECIM EN
" ;
c o ut < < " \ n\ t \ t~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ \ n" ; of s t r e a mf o; f o. ope n( " Spe c i me n. da t " , i os : : out | i os : : a pp) ; whi l e ( 1) { s pe c . Sno=s i z e of _s pe c ( ) ; g o t o x y ( 2 5 , 5 ) ; c out <<" SERI ALNUMBER : " ; got ox y ( 25, 6) ; c out <<" COMMONNAME
: " ;
g ot ox y ( 25, 7) ; c out <<" SCI ENTI FI CNAME : " ; got ox y ( 25, 8) ; c out <<" TYPE
: " ;
g ot ox y ( 25, 9) ; c out <<" NUMBEROFI TEMS : " ; got ox y ( 25, 10) ; c out << " COST(I NRS) : " ; g ot ox y ( 43, 5) ;
c o ut < >s pec . number ; got ox y ( 43, 10) ; c i n>>s pe c . c os t ; f o. wr i t e ( ( c ha r * ) &s pe c , s i z eof ( s pe c ) ) ; c out <<" \ n\ n\ n\ t \ t \ t ~~~~SAVI NG~~~~" ; ge t c h( ) ; } f o . c l o s e ( ) ; } / * SPECI MENSAVAI LABLE * / v oi dWor ki ng: : Av a i l a bl e _s pe c i me n( ) { c l r s c r ( ) ; f s t r e a mf i n; g ot ox y ( 28, 4) ; c out <<"SPECIM EN PRESENT" ;
got ox y ( 25, 5) ; cout <<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ; c out <<" \ n\ n\ n" ; c out <<"\ nS. NO
C. NAM E
S. NAM E
" ;
c out <<" " ; f i n. ope n( " Spe c i me n. da t " , i os : : i n) ; f i n. s e e kg( 0) ; i ntr =12; whi l e ( 1) { f i n. r e a d( ( c ha r * ) &s pe c , s i z eof ( s pe c ) ) ; i f ( f i n. e of ( ) ) br e a k;
got ox y ( 5, r ) ;
c o ut <
got ox y ( 57, r ) ;
c out <
} c out <<" \ n\ n\ n\ n\ t \ t \ t \ t Pr e s sa nyke y. . . " ; f i n. c l os e ( ) ; }
/ * SPECI MENDETAI LS * / v oi dWor ki ng: : Show_s pe c _de t a i l s ( ) { c l r s c r ( ) ; i ntn; c out < <" \ n" ; c out << " \ t \ t \ t SPECIM EN DETAILS
\ n" ;
c o ut < <" \ t \ t \ t~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~\ n" ; g ot ox y ( 30, 6) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n> >n; i f s t r e amf i n; f i n. ope n( " Spe c i me n. da t " , i os : : i n) ; f i n. s e e kg( 0) ; whi l e ( ! f i n. e of ( ) ) { f i n. r e a d( ( c ha r * ) &s pe c , s i z eof ( s pe c ) ) ;
i f ( s pe c . Sno==n) { got ox y ( 30, 8) ; c out <<" SERI ALNO
: " <
g ot ox y ( 30, 9) ; c out <<" COMMONNAME
: " <
got ox y ( 30, 10) ; c out << " SCI ENTI FI CNAME : " << s pe c . s na me ;
got ox y ( 30, 11) ;
c o ut < <" TYPE
: " <
got ox y ( 30, 12) ; c out <<" NUMBEROFI TEMS: " <
got ox y ( 30, 13) ; c out <<" COST
: " <
br e a k ; } } f i n. c l os e ( ) ; }
/ * MODI FYSPECI MEN * / v oi dWor ki ng: : Modi f y _s pe c i me n( ) { c l r s c r ( ) ; i ntne wc o s t , ne wno s ; charnewcname[ 30] , news name[ 30] , newt ype[ 30] ; f s t r e a ms y s ; s y s . ope n( " Spe c i me n. da t " , i os : : i n| i os : : out | i os : : bi na r y ) ; l ongc ur pos ; c o u t < < " \ n " ; c out <<" \ t \ t \ t M O D IFY SPECIM EN
\ n" ;
c o ut < <" \ t \ t \ t~ ~ ~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ ~~ ~ ~~ ~~ \ n" ; i ntmodc ode; g o t o x y ( 3 0 , 6 ) ; c out <<" ENTERTHESERI ALNUMBER: " ; c i n>>modcode ;
whi l e ( ! s y s . e of ( ) ) { c ur pos =s y s . t e l l g( ) ; s y s . r e a d( ( c ha r * ) &s pe c , s i z eof ( s pe c ) ) ; i f ( c he m. Sno==modc ode ) { g ot ox y ( 20, 8) ; c out <<" SERI ALNO
: " <
g o t o x y ( 2 0 , 9 ) ; c out <<" COMMONNAME
: " <
g o t o x y ( 2 0 , 1 0 ) ; c out << " SCI ENTI FI CNAME : " << s pe c . s name ; g o t o x y ( 2 0 , 1 1 ) ; c o ut < <" TYPE
: " <
g o t o x y ( 2 0 , 1 2 ) ; c out <<" NUMBEROFI TEMS : " <
: " <
g o t o x y ( 1 5 , 2 0 ) ; c out <<" ENTER' . ' TO RETAI NTHEVALUESOF CHARACTER" ; g o t o x y ( 1 5 , 2 1 ) ; c out <<" RETYPETHENUMBERTO RETAI N" ; g o t o x y ( 5 5 , 9 ) ;
get s ( newc name) ; g o t o x y ( 5 5 , 1 0 ) ; get s ( news name) ; g o t o x y ( 5 5 , 1 1 ) ;
g e t s ( ne wt y pe ) ; g o t o x y ( 5 5 , 1 2 ) ;
ci n>>newnos ; g o t o x y ( 5 5 , 1 3 ) ;
c i n> >ne wc o s t ;
i f ( s t r c mp( ne wc na me , " . " ) ! =0) s t r c p y ( s pe c . c na me , ne wc na me ) ;
i f ( s t r c mp( ne ws na me , " . " ) ! =0) s t r c py ( s pe c . s na me , ne ws na me ) ; i f ( s t r c mp( ne wt y pe , " . " ) ! =0) s t r c py ( s pe c . t y pe , ne wt y pe ) ; s pec . number =newnos ;
s pe c . c os t =ne wc os t ; br e a k; } } s y s . s e e kg( c ur pos ) ; s y s . wr i t e ( ( c ha r * ) &s pe c , s i z eof ( s pe c ) ) ; s y s . c l os e ( ) ; }
/ * ma i nf unc t i on * / v oi dma i n( ) { we l c o me ( ) ; ge t c h( ) ; }
OUTPUTS TheFol l owi ngs t r i ngofphot osi st heout putoft hepr oj e c t Ma i nMe nu
Of f i c eMa i nMe nu
St ude ntMe nu
Enr ol l i ngaSt ude nt
Di s pl ay i ngASt udentRec or d
Modi f yi ngaSt udentRec or d
Fe eMe nu
Se t t i ngFe eDa t e
Pay i ngFee
Te a c he rMe nu
Enr ol l i ngaTe a c he r
Di s pl a y i ngaTe a c he rRe c or d
Modi f yi ngaTea c herRoad
Li br a r yMe nu
BookMe nu
Addi ngaBook
BookDet ai l s
Modi f y i ngaBook
Me mbe rMe nu
Di s pl a y i ngMe mber s
I s s ui ngaBook
Re t ur ni ngaBook
Labor a t or ymenu
Phy s i c sLa b
Addi ngAne wI ns t r ume nt
Di s pl a y i ngi ns t r ume nt
Chemi s t r yLabor at ory
Addi ngaChe mi c a l
Chemi ca lDet ai l s
Modi f y i ngaChemi c a l
Addi ngaSy s t e m
Modi f y i ngaSy s t e m
Addi ngaSpe c i me n
Spec i menDet ai l s