SlideShare a Scribd company logo
1 of 32
This is to certify that the project entitled
Police station software
is prepared under my guidance and supervision by
NAME:-DHARMENDER LODHI
ROLL NUMBER: …………..
CLASS:XII A

SUBJECT: COMPUTER SCIENCE
SESSION:2013 - 2014.
SUBMITTED TO :- MR. AMIT
SIGNATURE:- …………..

1
Acknowledgment
I extend my deep sense of gratitude and sincere thanks to our
subject teacher Mr. Amit for his valuable support and guidance
in carrying my project work .
I also express my gratitude to all the faculty members, parents
and my fellow mates who have helped me to carry out this
work. Last but not the least, I thank my almighty God for His
blessing showed on me during this period .

Dharmender lodhi

2
CODING OF PROGRAM
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<string.h>
#include<stdlib.h>
#include<iomanip.h>
/****************************************************************************
*
Structure for Date
*
****************************************************************************/
struct date
{
int d;
int m;
int y;
};
/****************************************************************************
*
Structure for Details of Crime of Criminal
*
****************************************************************************/
struct court
{
char crime[20];
char act[20];
char cour[20];
char state[20];
};
/****************************************************************************
*
Structure for Physical Description of Criminal
*
****************************************************************************/
struct descp
{
char colour[20];
char face[20];
char imark[20];
char height[6];
};

//IDENTIFICATION MARKS(DEFORMITIES ETC.)

/****************************************************************************
*
Structure for Details of F.I.R.
*
3
****************************************************************************/
struct police
{
char station[50];
char fir_no[10];
date date_arrest;
};
/****************************************************************************
*
Class ' CRIMINAL ' for getting all information about
*
*
Convict and
*
****************************************************************************/
class criminal
{
char name[20];
char sex[3];
char conno[10];
char age[4];
char address[50];
//ADDRESS OF CRIMINAL BEFORE ARREST.
court COURT;
police POLICE;
descp des;
public:
int ncheck(char arr[]); // FUNCTION TO CHECK THAT INPUT IS NOT
// NUMERIC.
int s_check(char a[]); // FUNCTION TO CHECK THAT THE INPUT FOR
// SEX HAS ONLY 1 CHARACTER IN M OR F ONLY
void input(void);
void output(void);
void delete_rec(char con_no[]);
int dcheck(char n[]);
void display();
void remove();
int menu();
void modify();
void list();
void empty();
int concheck(char b[]);
};
// ====================> End of Class
Criminal<=============================
/***************************************************************************
4
*

Function for Checking Weither Input is Correct
*
***************************************************************************/
int criminal::ncheck (char arr[])
{
int i=0;
while (arr[i]!='0')
{
if (((arr[i]>64)&&(arr[i]<92))||((arr[i]>95)&&(arr[i]<124))
||(arr[i]==' '))
{
i++;
continue;
}
else
{
cout<<"nINCORRECT INPUT. TRY AGAIN !!n ";
return 0;
}
}
return 1;
}
/**************************************************************************
*
Function to Check whether Sex is Given Correctly
**************************************************************************/
int criminal::s_check(char a[])
{
clrscr();

if(( (a[0]=='m')||(a[0]=='f')||(a[0]=='M')||(a[0]=='F'))&&(a[1]=='0') )
{
return(1);
}
else
{
cout<<"n INCORRECT INPUT ,TRY AGAIN ";
return(0);
}
}

5

*
/****************************************************************************
*
Function for getting Convicts Record
*
****************************************************************************/
void criminal::input(void)
{
clrscr();
this->empty();criminal x;
int c = 0 ;
fstream filin;
filin.open("jail.dat",ios::app|ios::binary);
while(!c)
{
cout<<"n ENTER THE CONVICT CODE : ";
gets(this->conno);
c=x.concheck(this->conno);
}
c=0;
while(!c)
{
cout<<"n ENTER NAME OF CONVICT : ";
gets(this->name);
c= ncheck(this->name);
}
c=0;
while(!c)
{
cout<<"n ENTER SEX : ";
gets(this->sex);
c =s_check(this->sex);
}
cout<<"n enter address : ";
gets(this->address);
cout<<"n ENTER AGE : ";
gets(this->age);
clrscr();
cout<<"n ENTER DESCRIPTION : nnt ";
c=0;
while(!c)
6
{
cout<<"nENTER COLOUR: ";
gets(this->des.colour);
c=ncheck(this->des.colour);
}
c=0;
while(!c)
{
cout<<"n FACE DESCRIPTION: ";
gets(this->des.face);
c=ncheck(this->des.face);
}
cout<<"n ENTER HEIGHT(in cm's) : ";
gets(this->des.height);
cout<<"nENTER IDENTIFICATION MARKS(if no distinguishing marks,enter NONE):";
gets(this->des.imark);
clrscr();
cout<<"ENTER : nntt ";
c=0;
while(!c)
{
cout<<"COURT (from which the prisonor convicted) : ";
gets(this->COURT.cour);
c= ncheck(this->COURT.cour);
}
c=0;
while(!c)
{
cout<<"ntt STATE : ";
gets(this->COURT.state);
c= ncheck(this->COURT.state);
}
c=0;
while(!c)
{
cout<<"ntt CRIME : ";
gets(this->COURT.crime);
c= ncheck(this->COURT.crime);
7
}
cout<<"ntt ACT (under which convicted) : ";
gets(this->COURT.act);
clrscr();
cout<<"n ENTER : nntt";
cout<<"ntt COMPLETE ADDRESS OF POLICE STATION : ";
gets(this->POLICE.station);
cout<<"ntt FIR NO. (under which convict was arressted): ";
gets(this->POLICE.fir_no);
cout<<"ntt ENTER DATE OF ARREST(dd/mm/yy) :";
c=0;
while(!c)
{
cout<<"nttttt day : ";
cin>>this->POLICE.date_arrest.d;
if((this->POLICE.date_arrest.d>31)||(this->POLICE.date_arrest.d<1))
{
cout<<"nn THIS DATE DOES NOT EXIST,TRY AGAIN!! ";
c=0;
}
else
c=1;
}
c=0;
while(!c)
{
cout<<"nttttt month : ";
cin>>this->POLICE.date_arrest.m;
if((this->POLICE.date_arrest.m>12)||(this->POLICE.date_arrest.m<1))
{
cout<<"nn THIS MONTH DOES NOT EXIST,TRY AGAIN!! ";
c=0;continue;
}
else
c=1;
if((this->POLICE.date_arrest.d==31) &&((this->POLICE.date_arrest.m==2) || (this>POLICE.date_arrest.m==4) ||( this->POLICE.date_arrest.m==6) ||( this>POLICE.date_arrest.m==9) || (this->POLICE.date_arrest.m==11)))
{
cout<<"n THIS MONTH DOES NOT HAVE 31 DAYS n TRY AGAIN !! ";
c=0;
}
else
c=1;
8
}
c=0;
while(!c)
{
cout<<"nttttt year(in 4 digits) : ";
cin>>this->POLICE.date_arrest.y;
if((this->POLICE.date_arrest.y <= 1930)||(this->POLICE.date_arrest.y>2008) )
{
cout<<"n INCORRECT INPUT n TRY AGAIN!!n" ;
c=0;
}
else
c=1;
}
char ch;
do{
cout<<"n DO YOU WANT TO SAVE THIS INFORMATION(enter y or n) ";
cin>>ch;
if(ch=='y'||ch=='Y')
{
cout<<"nnt< RECORD HAS BEEN SAVED >";
filin.write((char*)this,sizeof(criminal));
}
else
{
if((ch!='n')&&(ch!='N'))
{
cout<<"n ENTER CORRECTLY n TRY AGAIN !! ";
}
}
} while((ch!='y')&&(ch!='Y')&&(ch!='n')&&(ch!='N'));
filin.close();
}//End of input functio
/***************************************************************************
*
Function for showing Convict's Record
*
***************************************************************************/
void criminal::output()
{
clrscr();

9
cout<<"@@@@@@@@@@@@@PERSONAL RECORD OF CONVICT
NO@@@@@@@@@@@@@@@@@@@@@@@@@@";
cout<<"nnCONVICT NO
:t";
puts(conno);
cout<<"nNAME
:t";
puts(this->name);
cout<<"nSEX
:t"<<this->sex;
cout<<"nnADDRESS
:t";
puts(this->address);
cout<<"nAGE
:t";
puts(this->age);
cout<<"nnDESCRIPTIONn";
cout<<"n1. COLOUR
:t";
puts(this->des.colour);
cout<<"n2. FACE
:t";
puts(this->des.face);
cout<<"n3. IDENTIFICATION MARK :t";
puts(this->des.imark);
cout<<"n4. HEIGHT
:t";
puts(this->des.height);
cout<<"nnnntttttpress a key to continue....";
getche();
clrscr();
cout<<"@@@@@@@@@@@@ CRIMINAL RECORD
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
cout<<"nnCOURT INFORMATIONnn ";
cout<<"n1. COURT FROM WHICH CONVICTED :t";
puts(this->COURT.cour);
cout<<"n2. STATE
:t";
puts(this->COURT.state);
cout<<"n3. CRIME
:t";
puts(this->COURT.crime);
cout<<"n4. ACT UNDER WHICH CONVICTED :t";
puts(this->COURT.act);
cout<<"nnnnnntttttt press a key to continue....";
getche();
clrscr();
cout<<"@@@@@@@@@@@@ CRIMINAL RECORD
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
cout<<"nnnPOLICE INFORMATION nn";
cout<<"n1. FIR NO.
:t";puts(this->POLICE.fir_no);
cout<<"n2. DATE OF ARREST
:t"<<this->POLICE.date_arrest.d<<"/"
<<POLICE.date_arrest.m<<"/"<<this->POLICE.date_arrest.y;
cout<<"nn3. POLICE STATION(where fir was lodged) :t";
puts(this->POLICE.station);
cout<<"nnnnntttttt press a key to continue....";
getche();
10
clrscr();
}//end of output function
/***************************************************************************
*
Function for Deleting The Record OF A Convict
*
***************************************************************************/
void criminal::delete_rec(char con_no[])
{
fstream filin;
filin.open("jail.dat",ios::in|ios::ate);
int q=filin.tellg();
int c=q/sizeof(criminal);
fstream temp;
temp.open("temp.dat",ios::out);
filin.seekg(0,ios::beg);
for(int i=0;i<c;i++)
{
filin.read((char*)this,sizeof(criminal));
if(strcmp(con_no,conno)!=0)
temp.write((char*)this,sizeof(criminal));
}
filin.close();
temp.close();
filin.open("jail.dat",ios::out);
temp.open("temp.dat",ios::in|ios::ate);
int a=temp.tellg();
int size=a/sizeof(criminal);
temp.seekg(0,ios::beg);
for(int k=0;k<size;k++)
{
temp.read((char*)this,sizeof(criminal));
filin.write((char*)this,sizeof(criminal));
}
filin.close();
temp.close();
cout<<"nn < THE RECORD HAS BEEN DELETED >";
}
//--------------------------------------------------------------------------int criminal::dcheck(char n[])
{
clrscr();
fstream file;
11
file.open("jail.dat",ios::in|ios::ate|ios::binary);
int x=0;int count=0,c;
int q=file.tellg();
c=q/sizeof(criminal);
file.close();
file.open("jail.dat",ios::in|ios::binary);
for(int i=0;i<c;i++)
{
file.read((char*)this,sizeof(criminal));
count++;
if(strcmp(n,conno)==0)
{
x++;
break;
}
}
if(x==0)
{
cout<<"n CONVICT NOT FOUND!! ";
return 0;
}
else
{
return count;
}
file.
close();
}

//---------------------------------------------------------------------------------void criminal::display()
{ clrscr();
char N[10];
int rec;
int loc;
cout<<"n ENTER THE CONVICT CODE OF CONVICT ";
cout<<" WHOSE INFORMATION YOU WANT :";
gets(N);
fstream file;
rec= this->dcheck(N);
file.open("jail.dat",ios::in|ios::binary);
if(rec!=0)
12
{
loc=(rec-1)*sizeof(criminal);
file.seekg(loc);
file.read((char*)this,sizeof(criminal));
this->output();
}
file.close();
}
//-----------------------------------------------------------------------------------------------------------------------void criminal::remove()
{
clrscr();
char no[10];int s;
cout<<"n ENTER THE CONVICT NO. OF THE CONVICT WHOSE RECORD YOU WISH TO ";
cout<<"DELETE :" ;
gets(no);
s= this->dcheck(no);
if(s!=0)
this->delete_rec(no);
}
//-------------------------------------------------------------------------------------------------------------------------int criminal::menu()
{ int ch;
do{
clrscr();
cout<<"n @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ MAIN MENU
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
cout<<"n PRESS :nn";
cout<<"nttt1. TO ADD RECORD/RECORDS ";
cout<<"nttt2. TO MODIFY RECORD/RECORDS ";
cout<<"nttt3. TO DISPLAY RECORD ";
cout<<"nttt4. TO DELETE RECORD ";
cout<<"nttt5. TO LIST ";
cout<<"nttt6. TO QUIT n ";
cin>>ch;
}
while((ch!=1)&&(ch!=2)&&(ch!=3)&&(ch!=4)&&(ch!=5)&&(ch!=6));
return(ch);
}
//-----------------------------------------------------------------------------------------void criminal::modify()
{
13
clrscr();fstream file ;char
npdr[10],ncrime[10],nact[10],nstate[10],ncourt[10],nstat[10],nfir[10];
char str[10],nprd[15],cno[10];
int check,loc;
criminal x;
date D;
cout<<"n MODIFICATION FUNCTION ";
cout<<"nENTER THE CONVICT NUMBER OF THE CONVICT ,TO BE MODIFIED: ";
gets(str);
check=this->dcheck(str);
if(check!=0)
{
file.open("jail.dat",ios::out|ios::ate);
int d=0;
while(!d)
{
cout<<"n ENTER THE MODIFIED CONVICT NO :";
gets(cno);
d= x.concheck(cno);
}
strcpy(conno,cno);
cout<<"n ENTER THE MODIFIED CRIME :";
gets(ncrime);
strcpy(COURT.crime,ncrime);
cout<<"n ENTER THE MODIFIED COURT RECORD: ";
cout<<"n ACT :";
gets(nact);
strcpy(COURT.act,nact);
cout<<"nSTATE : ";
gets(nstate);
strcpy(COURT.state,nstate);
cout<<"nCOURT : ";
gets(ncourt);
strcpy(COURT.cour,ncourt);
clrscr();
cout<<"n ENTER THE MODIFIED POLICE RECORD ";
cout<<"n STATION : ";
gets(nstat);
strcpy(POLICE.station,nstat);
cout<<"nFIR NO : ";
gets(nfir);
strcpy(POLICE.fir_no,nfir);
cout<<"n DATE OF ARREST(dd,mm,yyyy) ";
int c=0;
while(!c)
{
cout<<"nttttt day : ";
14
cin>>D.d;
if((D.d>31)||(D.d<1))
{
cout<<"nn THIS DATE DOES NOT EXIST,TRY AGAIN!! ";
c=0;
}
else
c=1;
}
c=0;
while(!c)
{
cout<<"nttttt month : ";
cin>>D.m;
if((D.m>12)||(D.m<1))
{
cout<<"nn THIS MONTH DOES NOT EXIST,TRY AGAIN!! ";
c=0;continue;
}
else
c=1;
if((D.d==31) &&((D.m==2) || (D.m==4) ||( D.m==6) ||( D.m==9) || (D.m==11)))
{
cout<<"n THIS MONTH DOES NOT HAVE 31 DAYS n TRY AGAIN !! ";
c=0;
}
else
c=1;
}
c=0;
while(!c)
{
cout<<"nttttt year(in 4 digits) : ";
cin>>D.y;
if((D.y <= 1930)||(D.y>2009) )
{
cout<<"n INCORRECT INPUT n TRY AGAIN!!n" ;
c=0;
}
else
c=1;
}
POLICE.date_arrest.d=D.d;
POLICE.date_arrest.m=D.m;
POLICE.date_arrest.y=D.y;
15
loc=(check-1)*sizeof(criminal);
file.seekp(loc);
file.write((char*)this,sizeof(criminal));
file.close();
}
}
//--------------------------------------------------------------------------------------------void criminal::list()
{ clrscr();
int j ;
fstream file;
file.open("jail.dat",ios::in|ios::ate|ios::binary);
int q=file.tellg();
int c=q/sizeof(criminal);
file.seekg(0);
cout<<"
"<<endl;
cout<<"
"<<endl;
cout<<"
CONVICT LIST "<<endl;
cout<<"
"<<endl;
cout<<"
"<<endl;
cout<<"n=============================================================
==================="<<endl;
cout<<"SNOtNAMEtttCONVICT NO.tttCRIME"<<endl;
cout<<"===============================================================
================="<<endl;
int i=0;
while(file.read((char*)this,sizeof(criminal)))
{ i++;
cout<<i<<"
";
for( j=0;j<strlen(this->name);j++)
cout<<this->name[j];
cout<<"ttt ";
for(j=0;j<strlen(this->conno);j++)
cout<<this->conno[j];
cout<<"ttt
";
for(j=0;j<strlen(this->COURT.crime);j++)
cout<<this->COURT.crime[j];
cout<<"n--------------------------------------------------------------------------------n";
if((i%3)==0&&(i!=c))
{
cout<<"Press a key to continue...........";
getch();
clrscr();
16
cout<<"n=============================================================
==================="<<endl;
cout<<"SNOtNAMEtttCONVICT NO.tttCRIME"<<endl;
cout<<"===============================================================
================="<<endl;
}
}
file.close();
}
//--------------------------------------------------------------------------------------------------void criminal::empty()
{
int i;
for(i=0;i<20;i++)
name[i]=' ';
for(i=0;i<10;i++)
conno[i]=' ';
for(i=0;i<3;i++)
sex[i]=' ';
for(i=0;i<4;i++)
age[i]=' ';
for(i=0;i<50;i++)
address[i]=' ';
for(i=0;i<20;i++)
COURT.cour[i]=' ';
for(i=0;i<20;i++)
COURT.crime[i]=' ';
for(i=0;i<20;i++)
COURT.act[i]=' ';
for(i=0;i<20;i++)
COURT.state[i]=' ';
for(i=0;i<20;i++)
des.colour[i]=' ';
for(i=0;i<20;i++)
des.imark[i]=' ';
for(i=0;i<20;i++)
des.face[i]=' ';
for(i=0;i<6;i++)
des.height[i]=' ';
for(i=0;i<50;i++)
POLICE.station[i]=' ';
for(i=0;i<10;i++)
POLICE.fir_no[i]=' ';
POLICE.date_arrest.m = 0;
POLICE.date_arrest.d = 0;
POLICE.date_arrest.y = 0;
}
17
//---------------------------------------------------------------------------------------------------------int criminal::concheck(char b[])
{
fstream file;char a[10];
int check=0;
file.open("jail.dat",ios::in|ios::ate);
int q=file.tellg();
int size=q/sizeof(criminal);
file.seekg(0,ios::beg);
for(int i=0;i<size;i++)
{
file.read((char*)this,sizeof(criminal));
strcpy(a,conno);
if(strcmp(b,a)==0)
{
check+=1;
break;
}
}
if(check==0)
{return(10);}
else
{
cout<<"n GIVEN CONVICT CODE ALREADY EXISTS!! "<<endl;
return(0);
}
file.close();
}
void main()
{
clrscr(); int x;
for(int i=0;i<3;i++)
{ clrscr();
cout<<"nCRIMINAL RECORD .nnttt< by DHARMENDER
LODHI>nnnnnnnntttt";
cout<<"ENTER PASSWORD..";
char*pass;
cin>>pass;
x=strcmp(pass,"123");
if(x==0)
{
break;
}
else
18
{
cout<<"a";
}
}
if(x==0)
{
int choice,ans='y';
criminal l;
while((ans=='y'|| ans=='Y'))
{
choice= l.menu();
switch(choice)
{
case 1:l.input();
break;
case 2 :l.modify();
break;
case 3:l.display();
break;
case 4:l.remove() ;
break;
case 5: l.list();
break;
case 6:
exit(0);
}
cout<<"nnnDO YOU WANT TO CONTINUE(press y to continue)..";
ans=getch();
if(ans=='y'||ans=='Y')
continue;
}
}}

19
OUTPUT OF PROGRAM

20
21
22
23
24
25
26
27
28
29
30
31
BOOKS:
 Computer science with c++ by Sumita
Arora
 Object oriented programming with c++
by E Balagurusamy

INTERNET:




www.icbse.com
www.cbseportal.com
www.c++projects.com

32

More Related Content

What's hot

Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shopvikram mahendra
 
Student management system project report c++
Student management system project report c++Student management system project report c++
Student management system project report c++Student
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++vikram mahendra
 
Project Report on Employee Management System.docx
Project Report on Employee Management System.docxProject Report on Employee Management System.docx
Project Report on Employee Management System.docxDhineshkumarPrakasam
 
Criminal Record System
Criminal Record SystemCriminal Record System
Criminal Record SystemCool Guy
 
CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19Gobinath Subramaniam
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management SystemAnjali Agrawal
 
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )Vidhi Kishor
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
Contact management system , phone book management system
Contact management system , phone book management systemContact management system , phone book management system
Contact management system , phone book management systemromie1995
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagementMickey
 
online movie ticket booking system
online movie ticket booking systemonline movie ticket booking system
online movie ticket booking systemSikandar Pandit
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Rushil Aggarwal
 
Online examination system
Online examination systemOnline examination system
Online examination systemNarendra Sonone
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result SystemKuMaR AnAnD
 

What's hot (20)

Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
 
Student management system project report c++
Student management system project report c++Student management system project report c++
Student management system project report c++
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 
Project Report on Employee Management System.docx
Project Report on Employee Management System.docxProject Report on Employee Management System.docx
Project Report on Employee Management System.docx
 
Criminal Record System
Criminal Record SystemCriminal Record System
Criminal Record System
 
CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19CS6611 Mobile Application Development Lab Manual-2018-19
CS6611 Mobile Application Development Lab Manual-2018-19
 
Recursion in c++
Recursion in c++Recursion in c++
Recursion in c++
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
 
Android Report
Android ReportAndroid Report
Android Report
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
How to Install Python on Windows
How to Install Python on WindowsHow to Install Python on Windows
How to Install Python on Windows
 
Contact management system , phone book management system
Contact management system , phone book management systemContact management system , phone book management system
Contact management system , phone book management system
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagement
 
online movie ticket booking system
online movie ticket booking systemonline movie ticket booking system
online movie ticket booking system
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
 
Chat Application
Chat ApplicationChat Application
Chat Application
 
Online examination system
Online examination systemOnline examination system
Online examination system
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result System
 

Viewers also liked

Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
Employee Management System Project Propsal
Employee Management System Project Propsal Employee Management System Project Propsal
Employee Management System Project Propsal Syed Junaid
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)lokesh meena
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 StudentsShahban Ali
 
Hotel Management In C++
Hotel Management In C++Hotel Management In C++
Hotel Management In C++Amish Mhatre
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safetyZay Yar Tun
 
Contact Management System
Contact Management SystemContact Management System
Contact Management SystemGopal Bhat
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science ProjectAshwin Francis
 
C++ coding for Banking System program
C++ coding for Banking System programC++ coding for Banking System program
C++ coding for Banking System programHarsh Solanki
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentationSaad Symbian
 
Library Management System
Library Management SystemLibrary Management System
Library Management SystemAditya Shah
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical FileAshwin Francis
 
12th bst project on marketing management
12th bst project on marketing management   12th bst project on marketing management
12th bst project on marketing management Jasmeet Singh
 

Viewers also liked (18)

Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
Employee Management System Project Propsal
Employee Management System Project Propsal Employee Management System Project Propsal
Employee Management System Project Propsal
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
 
Hotel Management In C++
Hotel Management In C++Hotel Management In C++
Hotel Management In C++
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safety
 
Contact Management System
Contact Management SystemContact Management System
Contact Management System
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
C++ coding for Banking System program
C++ coding for Banking System programC++ coding for Banking System program
C++ coding for Banking System program
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentation
 
practical file for class 12
practical file for class 12practical file for class 12
practical file for class 12
 
Hotel Management System
Hotel Management SystemHotel Management System
Hotel Management System
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
Transformer(Class 12 Investigatory Project)
Transformer(Class 12 Investigatory Project)Transformer(Class 12 Investigatory Project)
Transformer(Class 12 Investigatory Project)
 
12th bst project on marketing management
12th bst project on marketing management   12th bst project on marketing management
12th bst project on marketing management
 

Similar to C++ project on police station software

Computer Science Investigatory Project class 12th
Computer Science Investigatory Project class 12thComputer Science Investigatory Project class 12th
Computer Science Investigatory Project class 12thiamtheanupam
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQLvikram mahendra
 
Statistical computing project
Statistical computing projectStatistical computing project
Statistical computing projectRashmiSubrahmanya
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Yeardezyneecole
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Yeardezyneecole
 
Electricitybillsystemreport
ElectricitybillsystemreportElectricitybillsystemreport
Electricitybillsystemreportvikram mahendra
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Aman Deep
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Aman Deep
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfSyed Mustafa
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?jonbodner
 

Similar to C++ project on police station software (20)

Computer Science Investigatory Project class 12th
Computer Science Investigatory Project class 12thComputer Science Investigatory Project class 12th
Computer Science Investigatory Project class 12th
 
Quiz using C++
Quiz using C++Quiz using C++
Quiz using C++
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Document of Turbo ++ project|| Railway Reservation System project
Document of Turbo ++  project|| Railway Reservation System projectDocument of Turbo ++  project|| Railway Reservation System project
Document of Turbo ++ project|| Railway Reservation System project
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Statistical computing project
Statistical computing projectStatistical computing project
Statistical computing project
 
901131 examples
901131 examples901131 examples
901131 examples
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
Durgesh
DurgeshDurgesh
Durgesh
 
Text adventure
Text adventureText adventure
Text adventure
 
Electricitybillsystemreport
ElectricitybillsystemreportElectricitybillsystemreport
Electricitybillsystemreport
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
week-3x
week-3xweek-3x
week-3x
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
 
Gps c
Gps cGps c
Gps c
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?
 

Recently uploaded

How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 

Recently uploaded (20)

How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 

C++ project on police station software

  • 1. This is to certify that the project entitled Police station software is prepared under my guidance and supervision by NAME:-DHARMENDER LODHI ROLL NUMBER: ………….. CLASS:XII A SUBJECT: COMPUTER SCIENCE SESSION:2013 - 2014. SUBMITTED TO :- MR. AMIT SIGNATURE:- ………….. 1
  • 2. Acknowledgment I extend my deep sense of gratitude and sincere thanks to our subject teacher Mr. Amit for his valuable support and guidance in carrying my project work . I also express my gratitude to all the faculty members, parents and my fellow mates who have helped me to carry out this work. Last but not the least, I thank my almighty God for His blessing showed on me during this period . Dharmender lodhi 2
  • 3. CODING OF PROGRAM #include<iostream.h> #include<conio.h> #include<stdio.h> #include<fstream.h> #include<string.h> #include<stdlib.h> #include<iomanip.h> /**************************************************************************** * Structure for Date * ****************************************************************************/ struct date { int d; int m; int y; }; /**************************************************************************** * Structure for Details of Crime of Criminal * ****************************************************************************/ struct court { char crime[20]; char act[20]; char cour[20]; char state[20]; }; /**************************************************************************** * Structure for Physical Description of Criminal * ****************************************************************************/ struct descp { char colour[20]; char face[20]; char imark[20]; char height[6]; }; //IDENTIFICATION MARKS(DEFORMITIES ETC.) /**************************************************************************** * Structure for Details of F.I.R. * 3
  • 4. ****************************************************************************/ struct police { char station[50]; char fir_no[10]; date date_arrest; }; /**************************************************************************** * Class ' CRIMINAL ' for getting all information about * * Convict and * ****************************************************************************/ class criminal { char name[20]; char sex[3]; char conno[10]; char age[4]; char address[50]; //ADDRESS OF CRIMINAL BEFORE ARREST. court COURT; police POLICE; descp des; public: int ncheck(char arr[]); // FUNCTION TO CHECK THAT INPUT IS NOT // NUMERIC. int s_check(char a[]); // FUNCTION TO CHECK THAT THE INPUT FOR // SEX HAS ONLY 1 CHARACTER IN M OR F ONLY void input(void); void output(void); void delete_rec(char con_no[]); int dcheck(char n[]); void display(); void remove(); int menu(); void modify(); void list(); void empty(); int concheck(char b[]); }; // ====================> End of Class Criminal<============================= /*************************************************************************** 4
  • 5. * Function for Checking Weither Input is Correct * ***************************************************************************/ int criminal::ncheck (char arr[]) { int i=0; while (arr[i]!='0') { if (((arr[i]>64)&&(arr[i]<92))||((arr[i]>95)&&(arr[i]<124)) ||(arr[i]==' ')) { i++; continue; } else { cout<<"nINCORRECT INPUT. TRY AGAIN !!n "; return 0; } } return 1; } /************************************************************************** * Function to Check whether Sex is Given Correctly **************************************************************************/ int criminal::s_check(char a[]) { clrscr(); if(( (a[0]=='m')||(a[0]=='f')||(a[0]=='M')||(a[0]=='F'))&&(a[1]=='0') ) { return(1); } else { cout<<"n INCORRECT INPUT ,TRY AGAIN "; return(0); } } 5 *
  • 6. /**************************************************************************** * Function for getting Convicts Record * ****************************************************************************/ void criminal::input(void) { clrscr(); this->empty();criminal x; int c = 0 ; fstream filin; filin.open("jail.dat",ios::app|ios::binary); while(!c) { cout<<"n ENTER THE CONVICT CODE : "; gets(this->conno); c=x.concheck(this->conno); } c=0; while(!c) { cout<<"n ENTER NAME OF CONVICT : "; gets(this->name); c= ncheck(this->name); } c=0; while(!c) { cout<<"n ENTER SEX : "; gets(this->sex); c =s_check(this->sex); } cout<<"n enter address : "; gets(this->address); cout<<"n ENTER AGE : "; gets(this->age); clrscr(); cout<<"n ENTER DESCRIPTION : nnt "; c=0; while(!c) 6
  • 7. { cout<<"nENTER COLOUR: "; gets(this->des.colour); c=ncheck(this->des.colour); } c=0; while(!c) { cout<<"n FACE DESCRIPTION: "; gets(this->des.face); c=ncheck(this->des.face); } cout<<"n ENTER HEIGHT(in cm's) : "; gets(this->des.height); cout<<"nENTER IDENTIFICATION MARKS(if no distinguishing marks,enter NONE):"; gets(this->des.imark); clrscr(); cout<<"ENTER : nntt "; c=0; while(!c) { cout<<"COURT (from which the prisonor convicted) : "; gets(this->COURT.cour); c= ncheck(this->COURT.cour); } c=0; while(!c) { cout<<"ntt STATE : "; gets(this->COURT.state); c= ncheck(this->COURT.state); } c=0; while(!c) { cout<<"ntt CRIME : "; gets(this->COURT.crime); c= ncheck(this->COURT.crime); 7
  • 8. } cout<<"ntt ACT (under which convicted) : "; gets(this->COURT.act); clrscr(); cout<<"n ENTER : nntt"; cout<<"ntt COMPLETE ADDRESS OF POLICE STATION : "; gets(this->POLICE.station); cout<<"ntt FIR NO. (under which convict was arressted): "; gets(this->POLICE.fir_no); cout<<"ntt ENTER DATE OF ARREST(dd/mm/yy) :"; c=0; while(!c) { cout<<"nttttt day : "; cin>>this->POLICE.date_arrest.d; if((this->POLICE.date_arrest.d>31)||(this->POLICE.date_arrest.d<1)) { cout<<"nn THIS DATE DOES NOT EXIST,TRY AGAIN!! "; c=0; } else c=1; } c=0; while(!c) { cout<<"nttttt month : "; cin>>this->POLICE.date_arrest.m; if((this->POLICE.date_arrest.m>12)||(this->POLICE.date_arrest.m<1)) { cout<<"nn THIS MONTH DOES NOT EXIST,TRY AGAIN!! "; c=0;continue; } else c=1; if((this->POLICE.date_arrest.d==31) &&((this->POLICE.date_arrest.m==2) || (this>POLICE.date_arrest.m==4) ||( this->POLICE.date_arrest.m==6) ||( this>POLICE.date_arrest.m==9) || (this->POLICE.date_arrest.m==11))) { cout<<"n THIS MONTH DOES NOT HAVE 31 DAYS n TRY AGAIN !! "; c=0; } else c=1; 8
  • 9. } c=0; while(!c) { cout<<"nttttt year(in 4 digits) : "; cin>>this->POLICE.date_arrest.y; if((this->POLICE.date_arrest.y <= 1930)||(this->POLICE.date_arrest.y>2008) ) { cout<<"n INCORRECT INPUT n TRY AGAIN!!n" ; c=0; } else c=1; } char ch; do{ cout<<"n DO YOU WANT TO SAVE THIS INFORMATION(enter y or n) "; cin>>ch; if(ch=='y'||ch=='Y') { cout<<"nnt< RECORD HAS BEEN SAVED >"; filin.write((char*)this,sizeof(criminal)); } else { if((ch!='n')&&(ch!='N')) { cout<<"n ENTER CORRECTLY n TRY AGAIN !! "; } } } while((ch!='y')&&(ch!='Y')&&(ch!='n')&&(ch!='N')); filin.close(); }//End of input functio /*************************************************************************** * Function for showing Convict's Record * ***************************************************************************/ void criminal::output() { clrscr(); 9
  • 10. cout<<"@@@@@@@@@@@@@PERSONAL RECORD OF CONVICT NO@@@@@@@@@@@@@@@@@@@@@@@@@@"; cout<<"nnCONVICT NO :t"; puts(conno); cout<<"nNAME :t"; puts(this->name); cout<<"nSEX :t"<<this->sex; cout<<"nnADDRESS :t"; puts(this->address); cout<<"nAGE :t"; puts(this->age); cout<<"nnDESCRIPTIONn"; cout<<"n1. COLOUR :t"; puts(this->des.colour); cout<<"n2. FACE :t"; puts(this->des.face); cout<<"n3. IDENTIFICATION MARK :t"; puts(this->des.imark); cout<<"n4. HEIGHT :t"; puts(this->des.height); cout<<"nnnntttttpress a key to continue...."; getche(); clrscr(); cout<<"@@@@@@@@@@@@ CRIMINAL RECORD @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; cout<<"nnCOURT INFORMATIONnn "; cout<<"n1. COURT FROM WHICH CONVICTED :t"; puts(this->COURT.cour); cout<<"n2. STATE :t"; puts(this->COURT.state); cout<<"n3. CRIME :t"; puts(this->COURT.crime); cout<<"n4. ACT UNDER WHICH CONVICTED :t"; puts(this->COURT.act); cout<<"nnnnnntttttt press a key to continue...."; getche(); clrscr(); cout<<"@@@@@@@@@@@@ CRIMINAL RECORD @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; cout<<"nnnPOLICE INFORMATION nn"; cout<<"n1. FIR NO. :t";puts(this->POLICE.fir_no); cout<<"n2. DATE OF ARREST :t"<<this->POLICE.date_arrest.d<<"/" <<POLICE.date_arrest.m<<"/"<<this->POLICE.date_arrest.y; cout<<"nn3. POLICE STATION(where fir was lodged) :t"; puts(this->POLICE.station); cout<<"nnnnntttttt press a key to continue...."; getche(); 10
  • 11. clrscr(); }//end of output function /*************************************************************************** * Function for Deleting The Record OF A Convict * ***************************************************************************/ void criminal::delete_rec(char con_no[]) { fstream filin; filin.open("jail.dat",ios::in|ios::ate); int q=filin.tellg(); int c=q/sizeof(criminal); fstream temp; temp.open("temp.dat",ios::out); filin.seekg(0,ios::beg); for(int i=0;i<c;i++) { filin.read((char*)this,sizeof(criminal)); if(strcmp(con_no,conno)!=0) temp.write((char*)this,sizeof(criminal)); } filin.close(); temp.close(); filin.open("jail.dat",ios::out); temp.open("temp.dat",ios::in|ios::ate); int a=temp.tellg(); int size=a/sizeof(criminal); temp.seekg(0,ios::beg); for(int k=0;k<size;k++) { temp.read((char*)this,sizeof(criminal)); filin.write((char*)this,sizeof(criminal)); } filin.close(); temp.close(); cout<<"nn < THE RECORD HAS BEEN DELETED >"; } //--------------------------------------------------------------------------int criminal::dcheck(char n[]) { clrscr(); fstream file; 11
  • 12. file.open("jail.dat",ios::in|ios::ate|ios::binary); int x=0;int count=0,c; int q=file.tellg(); c=q/sizeof(criminal); file.close(); file.open("jail.dat",ios::in|ios::binary); for(int i=0;i<c;i++) { file.read((char*)this,sizeof(criminal)); count++; if(strcmp(n,conno)==0) { x++; break; } } if(x==0) { cout<<"n CONVICT NOT FOUND!! "; return 0; } else { return count; } file. close(); } //---------------------------------------------------------------------------------void criminal::display() { clrscr(); char N[10]; int rec; int loc; cout<<"n ENTER THE CONVICT CODE OF CONVICT "; cout<<" WHOSE INFORMATION YOU WANT :"; gets(N); fstream file; rec= this->dcheck(N); file.open("jail.dat",ios::in|ios::binary); if(rec!=0) 12
  • 13. { loc=(rec-1)*sizeof(criminal); file.seekg(loc); file.read((char*)this,sizeof(criminal)); this->output(); } file.close(); } //-----------------------------------------------------------------------------------------------------------------------void criminal::remove() { clrscr(); char no[10];int s; cout<<"n ENTER THE CONVICT NO. OF THE CONVICT WHOSE RECORD YOU WISH TO "; cout<<"DELETE :" ; gets(no); s= this->dcheck(no); if(s!=0) this->delete_rec(no); } //-------------------------------------------------------------------------------------------------------------------------int criminal::menu() { int ch; do{ clrscr(); cout<<"n @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ MAIN MENU @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; cout<<"n PRESS :nn"; cout<<"nttt1. TO ADD RECORD/RECORDS "; cout<<"nttt2. TO MODIFY RECORD/RECORDS "; cout<<"nttt3. TO DISPLAY RECORD "; cout<<"nttt4. TO DELETE RECORD "; cout<<"nttt5. TO LIST "; cout<<"nttt6. TO QUIT n "; cin>>ch; } while((ch!=1)&&(ch!=2)&&(ch!=3)&&(ch!=4)&&(ch!=5)&&(ch!=6)); return(ch); } //-----------------------------------------------------------------------------------------void criminal::modify() { 13
  • 14. clrscr();fstream file ;char npdr[10],ncrime[10],nact[10],nstate[10],ncourt[10],nstat[10],nfir[10]; char str[10],nprd[15],cno[10]; int check,loc; criminal x; date D; cout<<"n MODIFICATION FUNCTION "; cout<<"nENTER THE CONVICT NUMBER OF THE CONVICT ,TO BE MODIFIED: "; gets(str); check=this->dcheck(str); if(check!=0) { file.open("jail.dat",ios::out|ios::ate); int d=0; while(!d) { cout<<"n ENTER THE MODIFIED CONVICT NO :"; gets(cno); d= x.concheck(cno); } strcpy(conno,cno); cout<<"n ENTER THE MODIFIED CRIME :"; gets(ncrime); strcpy(COURT.crime,ncrime); cout<<"n ENTER THE MODIFIED COURT RECORD: "; cout<<"n ACT :"; gets(nact); strcpy(COURT.act,nact); cout<<"nSTATE : "; gets(nstate); strcpy(COURT.state,nstate); cout<<"nCOURT : "; gets(ncourt); strcpy(COURT.cour,ncourt); clrscr(); cout<<"n ENTER THE MODIFIED POLICE RECORD "; cout<<"n STATION : "; gets(nstat); strcpy(POLICE.station,nstat); cout<<"nFIR NO : "; gets(nfir); strcpy(POLICE.fir_no,nfir); cout<<"n DATE OF ARREST(dd,mm,yyyy) "; int c=0; while(!c) { cout<<"nttttt day : "; 14
  • 15. cin>>D.d; if((D.d>31)||(D.d<1)) { cout<<"nn THIS DATE DOES NOT EXIST,TRY AGAIN!! "; c=0; } else c=1; } c=0; while(!c) { cout<<"nttttt month : "; cin>>D.m; if((D.m>12)||(D.m<1)) { cout<<"nn THIS MONTH DOES NOT EXIST,TRY AGAIN!! "; c=0;continue; } else c=1; if((D.d==31) &&((D.m==2) || (D.m==4) ||( D.m==6) ||( D.m==9) || (D.m==11))) { cout<<"n THIS MONTH DOES NOT HAVE 31 DAYS n TRY AGAIN !! "; c=0; } else c=1; } c=0; while(!c) { cout<<"nttttt year(in 4 digits) : "; cin>>D.y; if((D.y <= 1930)||(D.y>2009) ) { cout<<"n INCORRECT INPUT n TRY AGAIN!!n" ; c=0; } else c=1; } POLICE.date_arrest.d=D.d; POLICE.date_arrest.m=D.m; POLICE.date_arrest.y=D.y; 15
  • 16. loc=(check-1)*sizeof(criminal); file.seekp(loc); file.write((char*)this,sizeof(criminal)); file.close(); } } //--------------------------------------------------------------------------------------------void criminal::list() { clrscr(); int j ; fstream file; file.open("jail.dat",ios::in|ios::ate|ios::binary); int q=file.tellg(); int c=q/sizeof(criminal); file.seekg(0); cout<<" "<<endl; cout<<" "<<endl; cout<<" CONVICT LIST "<<endl; cout<<" "<<endl; cout<<" "<<endl; cout<<"n============================================================= ==================="<<endl; cout<<"SNOtNAMEtttCONVICT NO.tttCRIME"<<endl; cout<<"=============================================================== ================="<<endl; int i=0; while(file.read((char*)this,sizeof(criminal))) { i++; cout<<i<<" "; for( j=0;j<strlen(this->name);j++) cout<<this->name[j]; cout<<"ttt "; for(j=0;j<strlen(this->conno);j++) cout<<this->conno[j]; cout<<"ttt "; for(j=0;j<strlen(this->COURT.crime);j++) cout<<this->COURT.crime[j]; cout<<"n--------------------------------------------------------------------------------n"; if((i%3)==0&&(i!=c)) { cout<<"Press a key to continue..........."; getch(); clrscr(); 16
  • 17. cout<<"n============================================================= ==================="<<endl; cout<<"SNOtNAMEtttCONVICT NO.tttCRIME"<<endl; cout<<"=============================================================== ================="<<endl; } } file.close(); } //--------------------------------------------------------------------------------------------------void criminal::empty() { int i; for(i=0;i<20;i++) name[i]=' '; for(i=0;i<10;i++) conno[i]=' '; for(i=0;i<3;i++) sex[i]=' '; for(i=0;i<4;i++) age[i]=' '; for(i=0;i<50;i++) address[i]=' '; for(i=0;i<20;i++) COURT.cour[i]=' '; for(i=0;i<20;i++) COURT.crime[i]=' '; for(i=0;i<20;i++) COURT.act[i]=' '; for(i=0;i<20;i++) COURT.state[i]=' '; for(i=0;i<20;i++) des.colour[i]=' '; for(i=0;i<20;i++) des.imark[i]=' '; for(i=0;i<20;i++) des.face[i]=' '; for(i=0;i<6;i++) des.height[i]=' '; for(i=0;i<50;i++) POLICE.station[i]=' '; for(i=0;i<10;i++) POLICE.fir_no[i]=' '; POLICE.date_arrest.m = 0; POLICE.date_arrest.d = 0; POLICE.date_arrest.y = 0; } 17
  • 18. //---------------------------------------------------------------------------------------------------------int criminal::concheck(char b[]) { fstream file;char a[10]; int check=0; file.open("jail.dat",ios::in|ios::ate); int q=file.tellg(); int size=q/sizeof(criminal); file.seekg(0,ios::beg); for(int i=0;i<size;i++) { file.read((char*)this,sizeof(criminal)); strcpy(a,conno); if(strcmp(b,a)==0) { check+=1; break; } } if(check==0) {return(10);} else { cout<<"n GIVEN CONVICT CODE ALREADY EXISTS!! "<<endl; return(0); } file.close(); } void main() { clrscr(); int x; for(int i=0;i<3;i++) { clrscr(); cout<<"nCRIMINAL RECORD .nnttt< by DHARMENDER LODHI>nnnnnnnntttt"; cout<<"ENTER PASSWORD.."; char*pass; cin>>pass; x=strcmp(pass,"123"); if(x==0) { break; } else 18
  • 19. { cout<<"a"; } } if(x==0) { int choice,ans='y'; criminal l; while((ans=='y'|| ans=='Y')) { choice= l.menu(); switch(choice) { case 1:l.input(); break; case 2 :l.modify(); break; case 3:l.display(); break; case 4:l.remove() ; break; case 5: l.list(); break; case 6: exit(0); } cout<<"nnnDO YOU WANT TO CONTINUE(press y to continue).."; ans=getch(); if(ans=='y'||ans=='Y') continue; } }} 19
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 24
  • 25. 25
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. 29
  • 30. 30
  • 31. 31
  • 32. BOOKS:  Computer science with c++ by Sumita Arora  Object oriented programming with c++ by E Balagurusamy INTERNET:    www.icbse.com www.cbseportal.com www.c++projects.com 32