This is to certify that the project entitled Police station software is prepared under my guidance and supervision by NAME:-DHARMENDER LODHI ROLL NUMBER: !! "LA##:$II A
SUBJECT: COMPUTER SCIECE SESSIO:!"#$ SESSIO:!"#$ % !"#&! #UBMI%%ED %O :- MR! AMI%
#I&NA%URE:- !!
1
Ac'no()edgmen* I e'tend (y deep sense of )ratit*de and sincere than+s to o*r s*,ject teacher Mr! Ami* for his -al*a,le s*pport and )*idance in carryin) (y project wor+ . I also e'press (y )ratit*de to all the fac*lty (e(,ers/ parents and (y fellow (ates who ha-e helped (e to carry o*t this wor+. 0ast ,*t not the least/ I than+ (y al(i)hty 1od for 2is ,lessin) showed on (e d*rin) this period .
D+armender )od+i
2
Ac'no()edgmen* I e'tend (y deep sense of )ratit*de and sincere than+s to o*r s*,ject teacher Mr! Ami* for his -al*a,le s*pport and )*idance in carryin) (y project wor+ . I also e'press (y )ratit*de to all the fac*lty (e(,ers/ parents and (y fellow (ates who ha-e helped (e to carry o*t this wor+. 0ast ,*t not the least/ I than+ (y al(i)hty 1od for 2is ,lessin) showed on (e d*rin) this period .
D+armender )od+i
2
CODING OF PROGRAM #include
%%ID0NIFICAION %%ID0N IFICAION MAR'3D0FORMII0' MAR'3D0F ORMII0' 0C.4
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 6
& 'tructure !or Details o! F.I.R. & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% struct $olice ( char station,7-) char 8r9no,1-) date date9arrest) +) %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & Class : CRIMINA; : !or "ettin" all in!ormation aout & & Conict and & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% class criminal ( char name,2-) char se=,6) char conno,1-) char a"e,>) char address,7-) %%ADDR0'' OF CRIMINA; ?0FOR0 ARR0'. court CO@R) $olice PO;IC0) desc$ des) $ulic int nchec/3char arr,4) %% F@NCION O CB0C BA INP@ I' NO %% N@M0RIC. int s9chec/3char a,4) %% F@NCION O CB0C BA B0 INP@ FOR %% '0 BA' ON; 1 CBARAC0R IN M OR F ON; oid in$ut3oid4) oid out$ut3oid4) oid delete9rec3char con9no,4) int dchec/3char n,4) oid dis$la*34) oid remoe34) int menu34) oid modi!*34) oid list34) oid em$t*34) int conchec/3char ,4) +) %% EEEEEEEEEEEEEEEEEEEE 0nd o! Class Criminal
&
Function !or Chec/in" either In$ut is Correct & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% int criminalnchec/ 3char arr,4 ( int iE-) hile 3arr,iHE:-:4 ( i! 333arr,i5>4JJ3arr,i44 LL3arr,iEE: :44 ( i) continue) + else ( cout<<nINCORR0C INP@. R AGAIN HHn ) return -) + + return 1) + %&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & Function to Chec/ hether 'e= is Gien Correctl* & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% int criminals9chec/3char a,4 ( clrscr34)
i!33 3a,-EE:m:4LL3a,-EE:!:4LL3a,-EE:M:4LL3a,-EE:F:44JJ3a,1EE:-:4 4 ( return314) + else ( cout<<n INCORR0C INP@ R AGAIN ) return3-4) + +
7
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & Function !or "ettin" Conicts Record & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&% oid criminalin$ut3oid4 ( clrscr34) thisem$t*34)criminal =) int c E - ) !stream 8lin) 8lin.o$en3Qail.datiosa$$Liosinar*4) hile3Hc4 ( cout<<n 0N0R B0 CONIC COD0 ) "ets3thisconno4) cE=.conchec/3thisconno4) + cE-) hile3Hc4 ( cout<<n 0N0R NAM0 OF CONIC ) "ets3thisname4) cE nchec/3thisname4) + cE-) hile3Hc4 ( cout<<n 0N0R '0 ) "ets3thisse=4) c Es9chec/3thisse=4) + cout<<n enter address ) "ets3thisaddress4) cout<<n 0N0R AG0 ) "ets3thisa"e4) clrscr34) cout<<n 0N0R D0'CRIPION nnt ) cE-) 5
hile3Hc4 ( cout<<n0N0R CO;O@R ) "ets3thisdes.colour4) cEnchec/3thisdes.colour4) + cE-) hile3Hc4 ( cout<<n FAC0 D0'CRIPION ) "ets3thisdes.!ace4) cEnchec/3thisdes.!ace4) + cout<<n 0N0R B0IGB3in cm:s4 ) "ets3thisdes.hei"ht4) cout<<n0N0R ID0NIFICAION MAR'3i! no distin"uishin" mar/senter NON04) "ets3thisdes.imar/4) clrscr34) cout<<0N0R nntt ) cE-) hile3Hc4 ( cout<<CO@R 3!rom hich the $risonor conicted4 ) "ets3thisCO@R.cour4) cE nchec/3thisCO@R.cour4) + cE-) hile3Hc4 ( cout<<ntt 'A0 ) "ets3thisCO@R.state4) cE nchec/3thisCO@R.state4) + cE-) hile3Hc4 ( cout<<ntt CRIM0 ) S
"ets3thisCO@R.crime4) cE nchec/3thisCO@R.crime4) + cout<<ntt AC 3under hich conicted4 ) "ets3thisCO@R.act4) clrscr34) cout<<n 0N0R nntt) cout<<ntt COMP;00 ADDR0'' OF PO;IC0 'AION ) "ets3thisPO;IC0.station4) cout<<ntt FIR NO. 3under hich conict as arressted4 ) "ets3thisPO;IC0.8r9no4) cout<<ntt 0N0R DA0 OF ARR0'3dd%mm%**4 ) cE-) hile3Hc4 ( cout<<nttttt da* ) cinthisPO;IC0.date9arrest.d) i!33thisPO;IC0.date9arrest.d614LL3thisPO;IC0.date9arrest.d<144 ( cout<<nn BI' DA0 DO0' NO 0I'R AGAINHH ) cE-) + else cE1) + cE-) hile3Hc4 ( cout<<nttttt month ) cinthisPO;IC0.date9arrest.m) i!33thisPO;IC0.date9arrest.m124LL3thisPO;IC0.date9arrest.m<144 ( cout<<nn BI' MONB DO0' NO 0I'R AGAINHH ) cE-)continue) + else cE1) i!33thisPO;IC0.date9arrest.dEE614 JJ33thisPO;IC0.date9arrest.mEE24 LL 3thisPO;IC0.date9arrest.mEE>4 LL3 thisPO;IC0.date9arrest.mEE54 LL 3 thisPO;IC0.date9arrest.mEEK4 LL 3thisPO;IC0.date9arrest.mEE11444 ( cout<<n BI' MONB DO0' NO BA0 61 DA' n R AGAIN HH ) cE-) + T
else cE1) + cE-) hile3Hc4 ( cout<<nttttt *ear3in > di"its4 ) cinthisPO;IC0.date9arrest.*) i!33thisPO;IC0.date9arrest.*
clrscr34) cout<<VVVVVVVVVVVVVP0R'ONA; R0CORD OF CONIC NOVVVVVVVVVVVVVVVVVVVVVVVVVV) cout<<nnCONIC NO t) $uts3conno4) cout<<nNAM0 t) $uts3thisname4) cout<<n'0 t<. B0IGB t) $uts3thisdes.hei"ht4) cout<<nnnnttttt$ress a /e* to continue....) "etche34) clrscr34) cout<<VVVVVVVVVVVV CRIMINA; R0CORD VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ) cout<<nnCO@R INFORMAIONnn ) cout<<n1. CO@R FROM BICB CONIC0D t) $uts3thisCO@R.cour4) cout<<n2. 'A0 t) $uts3thisCO@R.state4) cout<<n6. CRIM0 t) $uts3thisCO@R.crime4) cout<<n>. AC @ND0R BICB CONIC0D t) $uts3thisCO@R.act4) cout<<nnnnnntttttt $ress a /e* to continue....) "etche34) clrscr34) cout<<VVVVVVVVVVVV CRIMINA; R0CORD VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V) cout<<nnnPO;IC0 INFORMAION nn) cout<<n1. FIR NO. t)$uts3thisPO;IC0.8r9no4) cout<<n2. DA0 OF ARR0' t<
<
11
%% int criminaldchec/3char n,4 ( clrscr34) !stream 8le) 8le.o$en3Qail.datiosinLiosateLiosinar*4) int =E-)int countE-c) int WE8le.tell"34) cEW%siUeo!3criminal4) 8le.close34) 8le.o$en3Qail.datiosinLiosinar*4) !or3int iE-)i
%% oid criminaldis$la*34 ( clrscr34) char N,1-) int rec) int loc) cout<<n 0N0R B0 CONIC COD0 OF CONIC ) cout<< BO'0 INFORMAION O@ AN ) 12
"ets3N4) !stream 8le) recE thisdchec/3N4) 8le.o$en3Qail.datiosinLiosinar*4) i!3recHE-4 ( locE3rec14&siUeo!3criminal4) 8le.see/"3loc4) 8le.read33char&4thissiUeo!3criminal44) thisout$ut34) + 8le.close34) + %% oid criminalremoe34 ( clrscr34) char no,1-)int s) cout<<n 0N0R B0 CONIC NO. OF B0 CONIC BO'0 R0CORD O@ I'B O ) cout<<D0;00 ) "ets3no4) sE thisdchec/3no4) i!3sHE-4 thisdelete9rec3no4) + %% int criminalmenu34 ( int ch) do( clrscr34) cout<<n VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV MAIN M0N@ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ) cout<<n PR0'' nn) cout<<nttt1. O ADD R0CORD%R0CORD' ) cout<<nttt2. O MODIF R0CORD%R0CORD' ) cout<<nttt6. O DI'P;A R0CORD ) cout<<nttt>. O D0;00 R0CORD ) cout<<nttt7. O ;I' ) cout<<nttt5. O X@I n ) cinch) 16
+ hile33chHE14JJ3chHE24JJ3chHE64JJ3chHE>4JJ3chHE74JJ3chHE544) return3ch4) + %% oid criminalmodi!*34 ( clrscr34)!stream 8le )char n$dr,1-ncrime,1-nact,1-nstate,1-ncourt,1-nstat,1-n8r,1-) char str,1-n$rd,17cno,1-) int chec/loc) criminal =) date D) cout<<n MODIFICAION F@NCION ) cout<<n0N0R B0 CONIC N@M?0R OF B0 CONIC O ?0 MODIFI0D ) "ets3str4) chec/Ethisdchec/3str4) i!3chec/HE-4 ( 8le.o$en3Qail.datiosoutLiosate4) int dE-) hile3Hd4 ( cout<<n 0N0R B0 MODIFI0D CONIC NO ) "ets3cno4) dE =.conchec/3cno4) + strc$*3connocno4) cout<<n 0N0R B0 MODIFI0D CRIM0 ) "ets3ncrime4) strc$*3CO@R.crimencrime4) cout<<n 0N0R B0 MODIFI0D CO@R R0CORD ) cout<<n AC ) "ets3nact4) strc$*3CO@R.actnact4) cout<<n'A0 ) "ets3nstate4) strc$*3CO@R.statenstate4) cout<<nCO@R ) "ets3ncourt4) strc$*3CO@R.courncourt4) clrscr34) cout<<n 0N0R B0 MODIFI0D PO;IC0 R0CORD ) cout<<n 'AION ) "ets3nstat4) strc$*3PO;IC0.stationnstat4) 1>
cout<<nFIR NO ) "ets3n8r4) strc$*3PO;IC0.8r9non8r4) cout<<n DA0 OF ARR0'3ddmm****4 ) int cE-) hile3Hc4 ( cout<<nttttt da* ) cinD.d) i!33D.d614LL3D.d<144 ( cout<<nn BI' DA0 DO0' NO 0I'R AGAINHH ) cE-) + else cE1) + cE-) hile3Hc4 ( cout<<nttttt month ) cinD.m) i!33D.m124LL3D.m<144 ( cout<<nn BI' MONB DO0' NO 0I'R AGAINHH ) cE-)continue) + else cE1) i!33D.dEE614 JJ33D.mEE24 LL 3D.mEE>4 LL3 D.mEE54 LL3 D.mEEK4 LL 3D.mEE11444 ( cout<<n BI' MONB DO0' NO BA0 61 DA' n R AGAIN HH ) cE-) + else cE1) + cE-) hile3Hc4 ( cout<<nttttt *ear3in > di"its4 ) cinD.*) i!33D.*
cout<<n INCORR0C INP@ n R AGAINHHn ) cE-) + else cE1) + PO;IC0.date9arrest.dED.d) PO;IC0.date9arrest.mED.m) PO;IC0.date9arrest.*ED.*) locE3chec/14&siUeo!3criminal4) 8le.see/$3loc4) 8le.rite33char&4thissiUeo!3criminal44) 8le.close34) + + %% oid criminallist34 ( clrscr34) int Q ) !stream 8le) 8le.o$en3Qail.datiosinLiosateLiosinar*4) int WE8le.tell"34) int cEW%siUeo!3criminal4) 8le.see/"3-4) cout<< <
cout<<ttt ) !or3QE-)Q)i4 a"e,iE: :) !or3iE-)i<7-)i4 address,iE: :) !or3iE-)i<2-)i4 CO@R.cour,iE: :) !or3iE-)i<2-)i4 CO@R.crime,iE: :) !or3iE-)i<2-)i4 CO@R.act,iE: :) !or3iE-)i<2-)i4 CO@R.state,iE: :) !or3iE-)i<2-)i4 des.colour,iE: :) !or3iE-)i<2-)i4 des.imar/,iE: :) !or3iE-)i<2-)i4 des.!ace,iE: :) 1S
!or3iE-)i<5)i4 des.hei"ht,iE: :) !or3iE-)i<7-)i4 PO;IC0.station,iE: :) !or3iE-)i<1-)i4 PO;IC0.8r9no,iE: :) PO;IC0.date9arrest.m E -) PO;IC0.date9arrest.d E -) PO;IC0.date9arrest.* E -) + %% int criminalconchec/3char ,4 ( !stream 8le)char a,1-) int chec/E-) 8le.o$en3Qail.datiosinLiosate4) int WE8le.tell"34) int siUeEW%siUeo!3criminal4) 8le.see/"3-iose"4) !or3int iE-)i
cout<<nCRIMINA; R0CORD .nnttt< * DBARM0ND0R ;ODBInnnnnnnntttt) cout<<0N0R PA''ORD..) char&$ass) cin$ass) =Estrcm$3$ass1264) i!3=EE-4 ( rea/) + else ( cout<<a) + + i!3=EE-4 ( int choiceansE:*:) criminal l) hile33ansEE:*:LL ansEE::44 ( choiceE l.menu34) sitch3choice4 ( case 1l.in$ut34) rea/) case 2 l.modi!*34) rea/) case 6l.dis$la*34) rea/) case >l.remoe34 ) rea/) case 7 l.list34) rea/) case 5 e=it3-4) + cout<<nnnDO O@ AN O CONIN@03$ress * to continue4..) ansE"etch34) i!3ansEE:*:LLansEE::4 continue) + ++
1K
O@P@ OF PROGRAM
2-
21
22
26
2>
27
25
2S
2T
2K
6-
61