You are on page 1of 47

PROJECT REPORT ON

VEHICLE MANAGEMENT SYSTEM

SUBMITTED AS A PART OF PROJECT FOR THE BACHELOR OF


TECHONOLOGY IN COMPUTER SCIENCE AND ENGINEERING

SUBMITTED BY:

SUBMITTED TO:

ABHINAV GUPTA (101/06)


NAGRA

Ms.

ABHINAV KAPOOR (102/06)


DEPT.

LECTURER CSE/IT

DEEPAK BHARDWAJ (111/06)


GITESH GUPTA (117/06)

SUNITA

Page |2

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


INSTITUTE OF ENGINEERING AND EMERGING TECHNOLOGY,
BADDI DISTT. SOLAN (H.P.)

ACKNOWLEDGEMENT
Our journey towards achieving the destination for the
design and development of This Project has finally
come to a fruitful culmination. Our efforts and whole
hearted cooperation of our lecturer has ended on a
successful note. During this journey we faced numerous
unforeseen problems and unknown challenges. Many
people met us during this endeavour and enriched us
with their support and knowledge both personally and
professionally that resulted in the project being for
better than it could possibly have been without them.

We are deeply indebted to our teacher Ms. Sunita,


whose inspiration and invaluable guidance has been
unfailingly available to us at all stages of our practical.

Page |3

TABLE OF CONTENTS

Acknowledgement

02

Candidate Declaration

04

Project Selection

05

Introduction

Requirements

07

Language Selection

08

Feasibility Study

19

Design Phase

22

Coding Of Project

26

Bibliography

42

Limitations Of Project

06

43

Page |4

CANDIDATE DECLARATION
It is here by certified that the work which is being
presented here, VEHICLE MANAGEMENT SYSTEM in
C++ and file is fulfilment of the requirements for the
award of the degree of Bachelor of Technology in
Computer Science And Engineering Department under
Himachal Pradesh University, Shimla (H.P.), is an
authentic record of our own work carried out during the
4TH Semester as part of the System Analysis And
Design project work, under the supervision of
Ms. Sunita Nagra
Lect. CSE/IT Dept.

Page |5

PROJECT SELECTION
Today the world is considered as a competitive world
where everybody seeks for accuracy in least time.
Earlier paper work was the means to keep various
records. It was very time consuming and not even that
accurate. So, we decided to design and develop the
Project

called

VEHICLE

MANAGEMENT

SYSTEM

which eliminates the paper work and provides better


option to the people for their Vehicle records. It deals
with the maintenance of the records of the different
categories of vehicles and their owners. The user of
this program can add records of the vehicles and their
owners, view these records and can also edit them.

Page |6

INTRODUCTION

The project Vehicle Management System deals


with the maintenance of the records of the different
categories of vehicles and their owners. The user of this
program can add records of the vehicles and their
owners, view these records and can also edit them.
This project is basically aimed for the Road and
Transport Office which have large number of records of
different types of vehicles to be maintained. The
project makes it easier to search these records and edit
them. The project has a very user friendly interface and
all the operations that can be performed in the project
are self explanatory. It reduces the effort required to
manually maintain all these records.
This project will really reduce the laborious record
keeping.

Page |7

REQUIREMENTS
A computer system with the following specifications:
HARDWARE REQUIREMENTS:
100 MB Hard Disk
256 MB RAM
DVD R/W
VGA Monitor
110 Keys Keyboard
Optical Mouse
Printer

SOFTWARE REQUIREMENTS:
Operating System (Windows XP/Vista)
MS-Office

Turbo C/C++ Compiler

Page |8

LANGUAGE SELECTION

In our project VEHICLE MANAGEMENT SYSTEM we


are

using

C++

language

which

supports

object

oriented programming style. It provides the ability to


build the classes and objects. The main advantages of
OOPS are
1.

Data Encapsulation.

2.

Data hiding and Access Mechanism.

3.

Automatic initialization.

4.

Operator Overloading.

Language that supports programming with objects are


said to be object-oriented programming language.
Object Oriented programming language incorporates all
of object based programming features along with two
additional features, namely inheritance and dynamic
binding.

Page |9

The C++ supports all these features. It works with


classes, objects, inheritance, and dynamic binding;
however some of these are not included in the project.
BENEFITS OF OOPS:
It offers several benefits to both the programmer and
the user. It contributes to the solution of many
problems associated with the development and quality
of software products. The new technology promises
greater programmer L productivity, better quality of
software and lesser maintenance cost.

FEATURES OF OOPS:
Emphasis is on data rather than procedure.
Programs are divided into what are known as
procedure.
Data

structure

are

designed

such

that

they

characterize the objects.


Functions that operate on data of an object are
tied together in the data structures.
Data is hidden and cannot be accessed by external
functions.

P a g e | 10

Objects may communicate with each other through


functions.
New data and functions can be easily added
whenever necessary.
Follows bottom-up approach in program design.
STRUCTURE OF A C++ PROGRAM:
//hello.cpp(program name)
//this program displays the message hello world
#include<iostream.h>
#include<conio.h>
void main()
{
cout<<"HELLO WORLD";
getch();
}
The components of C++ program are

Comments
Comments are used for better understanding of the
program understanding. The comment entries starts
with a // symbol and terminate at the end of the line.
#include directive
The #include directive instructs the compiler to include
the contents of the file enclosed within angular
brackets into the source file.
Function
10

P a g e | 11

A function is defined by function name and a function


body. In above program main() is function name. All
programs must have a function called main(). A
function body is surrounded by curly braces {}. The
braces delimit a block of program statements.

FUNDAMENTAL DATA TYPES:


Data type

No. of bytes

Used for representing

Char

character

Int

integer

Float

floating point no.

OPERATORS:
Arithmetic operators:
C++ language have five arithmetic operators
Addition(+), subtraction(-), multiplication(*), division(/)
and a new modulo(%) operator. The modulo operator
returns the remainder when an integer is divided by
another. Modulo operators only works with integers.
Relational operators:
Operator

Meaning

>
<
==
!=

greater than
less than
equal to
not equal to
11

P a g e | 12

>=
<=

greater than or equal to


less tan or equal to

LOGICAL OPERATORS:
1. AND(&&): It combines two conditional expressions
and evaluates true only if both conditionals are fulfilled.
2. OR(||): It combines two conditional expressions, and
evaluates to true if any one of the condition is fulfilled.
3. NOT(!): It is a unary operator and takes only one
operand. The effect of the ! is that the logical value of
its operand is reversed.

CONDITIONAL CONSTRUCTS:
Simple if statement
if else statement
nested if else statement
switch case constructs.

LOOP CONSTRUCTS:
while loop
do while loop
for loop.

CLASS:

12

P a g e | 13

Class is group of objects that share common properties


and relationships. In C++ a class is a new data type
that contains member variables and member 0
functions that operate on the variable. A class is
defined with a keyword class.
ACCESS SPECIFIERS:
A body of class contains three access specifiers:
private
public
protected

OBJECT:
An object is an entity that can store data and, send and
receive messages. It is an instance of a class.

CONSTRUCTORS:
A constructor is a member function whose task is to
initialize the objects of its class. Its name is same as the
class name.

DESTRUCTORS:
A destructor is used to destroy the objects that have
been created by a constructor. Its name is same as
constructor but it starts with a tilde (~) sign.
13

P a g e | 14

OPERATOR OVERLOADING:
It is a language feature that allows the operator to be
given more than one definition. The types of the
arguments with which the operator is called,
determines which definition will be used.
The process of overloading involves the following steps:
Create a class that defines the data type that to
be used in the overloading operation.
Declare the operator function operator op () in
the public part of the class.
Define the operator function to implement the
required operation.

INHERITANCE:
A relationship between classes such that the state and
implementation of an object or module should be
private to that object or module and only accessible via
its public interface.
Types of inheritance:
Single Inheritance
14

P a g e | 15

Multiple Inheritance
Hierarchical Inheritance
Multilevel Inheritance
Hybrid Inheritance
POLYMORPHISM:
A property by which we can send the same message to
the object of several different classes, and each object
can respond in different way depending on its class. We
can send such a message without knowing to which of
the classes object belongs. In C++, polymorphism is
implemented by means of virtual function and dynamic
binding.
Virtual Function:
A virtual function is a function that is declared as virtual
in base class and is redefined by a derived class. For
declaring a function virtual we use the keyword virtual.
Dynamic Binding:
It means that the code associated with a given
procedure call is not known until the time of call at runtime.
Encapsulation:
The wrapping up of data and function into a single unit
(called class) is known as encapsulation. It a most
striking feature of a class. The data is not accessible to
outside world.
15

P a g e | 16

Data Abstraction:
Abstraction refers to the act of representing essential
features without including the background details or
explanations. Since the classes use the concept of data
abstraction, they are known as Abstract Data Types
(ADT).

POINTERS:
A pointer is variable that can hold the address of other
variable, structures and functions that are used in the
program.
FUNCTIONS:
A function is a set of instructions to carry out a particular
task. Defining a function means writing an actual code for
function which does a specific and identifiable task.

FILES:
A file is a group of related records treated as a unit. In file
handling we use stream class.

16

P a g e | 17

Details Of Stream Classes:

Class

Contents

Filebuf

Its purpose is to set the file buffer to


read and write. Contains close() and
open() as members.

fstreambase
Provides operation common to the file
streams. Serves as base for fstream,
ifstream and ofstream class. Contains
open() and close() function.
Ifstream

Provides input operations. Contains


input() mode. Inherits the function get(),
getline(),read(),seekg() and tellg() functions
from istream.

Ofstream

Provides output operations. Contains


open()
mode.
Inherits
the
function
put(),write(),seekp() and tellp() functions
from ostream.

Fstream

Provides support for simultaneous input

17

P a g e | 18

and output operations. Contains open()


with default input mode. Inherits all the
functions from istream and ostream classes
through iostream.

Functions For Manipulation of File Pointers:

seekg()moves get pointer(i/p) to a specific location.


seekp()Moves put pointer(o/p) to a specific location.
tellg() Gives current position of the get pointer.
tellp() Gives current position of the put pointer.

File Modes:

Parameter

Meaning

ios::app

Append to end-of-file.

ios::ate

Go to end-of-file on opening.

ios::binary

Binary file.

ios::in

Open file for reading only.

ios::nocreate Open fails if the file does not exists.


ios::noreplaceOpen fails if file already exists.
ios::out

Open file for writing only.


18

P a g e | 19

ios::trunc

Delete the contents of the file if it exists.

FEASIBILITY STUDY
Depending upon the results of the initial investigation,
the survey is expected to a more detailed feasibility
study. A feasibility study is test of system proposal
according to its workability, impact on the organization,
ability to meet users need and effective use of
resources. It includes main questions:
What is the users need?
2. What resources are available for given candidate
system?
3.
What is the likely impact of the candidate system
on the organization?
Three consideration are involved in feasibility
analysis, Economical, Technical and Operational?
1.

Technical Feasibility:
Technical Feasibility concern around the existing
computer system (hardware, software etc.) and to what
extent it supports the proposed addition.
The technical needs of the
considerably, but might include:

system

may

vary

19

P a g e | 20

The facility to produce output in a given time.


Response time under certain conditions.
Ability to process a certain volume of transaction
at
particular speed.
Facilitate to communicate data to distant location.
Economical Feasibility:
Economic analysis is the most frequently used method
for evaluating the effectiveness of the candidate
system. More commonly known as cost/benefit analysis,
the procedure is to determine the benefits and saving
that are expected from a candidate system, and
compare them with costs.

Operational Feasibility:
People are inherently resistant to change. And
computers are known to facilitate change. An estimate
should be made of how strong reaction the user staff is
likely to have towards the development of computerized
system. The system should be simple to operate so that
layman can also understand what system is, and how
he can be benefited from the system.

20

P a g e | 21

SYSTEM REQUIREMENT

PURPOSE:
The purpose of this document is to describe all the
external requirements for a manual management
system. It also describes the interface for the system.

SCOPE:
This document is only one that describes the
requirements of the system. It is meant for use by the
developers and will also be the basis for validating the
final delivered system. Any change made to the
requirement in future will have to go through a formal
change approval process the developer is responsible
for asking the clarification where necessary and will not
make any alterations.

21

P a g e | 22

DESIGN PHASE
The most creative and challenging phase of SYSTEM
DEVLOPMENT LIFE CYCLE is SYSTEM DESIGN. The
term design describes a final system and the process by
which it is developed. It refers to the technical
specification that will be applied in implementing the
candidate system. It also includes the construction of
program and program testing.
The key question here is: HOW THE PROBLEM SHOULD
BE
SOLVED?

Design Phase is basically of two types:


Traditional Design Phase
Object-Oriented Design Phase
But we normally follow the traditional design in the form
of DFDs
22

P a g e | 23

DATA FLOW DIAGRAMS:


DFD is known as a BUBBLE CHART. It has purpose of
clarifying the system requirements and identify major
transformations that will become programs in system
design. DFDs consists of a series of lines represents
data flow.
DFD SYMBOLS:
The following are the symbols that re used in making a
DFD:
An open rectangle is data store-data at rest, or a
temporary repository of data.
A square defines a source of destination of system
data.
An arrow identifies data flow-data in motion. It is
pipelined through which information flows.
A circle or bubble represents a process that
transforms incoming data flow into outgoing data flows.
Primitive Symbols Used for Constructing DFDs:

23

P a g e | 24

FUNCTION SYMBOL:

A function is represented using a circle. This symbol is


called a Process or a Bubble. Bubble represents a
process that transforms incoming data flow(s) into
outgoing d\ata flow(s).

EXTERNAL ENTITY SYMBOL:

An entity is represented using a rectangle, which


signifies a source or destination of data. The external
entities are those physical entities external to the
software system, which interact with the system by
inputting data to the system or by consuming the
produced by the system.

DATA FLOW SYMBOL:

A data flow is represented using an arrow, which


signifies data in motion. It represents the data flow
occurring between two processes or between an entity
and a process, in the direction flow arrow.
24

P a g e | 25

DATA STORE SYMBOL:

A data store is represented using a two parallel lines or


a open rectangle, which signifies data at rest or a
temporary repository of data. It represent a logical file,
which represent data structure, or a physical line on
disk.

DEVELOPING THE DFD MODEL OF A SYSTEM


To develop a higher-level DFD model, process a
decomposed into their sub-processes and the data flow
among these sub-processes are identified.
To develop a data flow model of a system, the most
abstract representation of the problem is worked out
and then higher-level DFDs developed.

Level 0:
The level 0 is the most abstract representation of the
system. It represents the entire system as a single
bubble. This bubble is labelled according to the main
function of the system. The various external entities
with which the system interacts and the data flows
occurring between the system and the external entities
are also represented.

25

P a g e | 26

The name level 0 is well justified because it represents


the context in which the system is to exist. The level 0
diagram is also known as context diagram.

Level 1:
To develop the level 1 DFD, examine the high-level
function requirement. If there are between three or
seven high level functional requirements, then these
can be represented directly as bubbles, otherwise they
need to be combined, between them examine the input
data to these functions and the data output by these
functions and represents them in the diagram.

CONTEXT FREE DIAGRAM

Searching
Section

Data Base
Section
Vehicle
Management
System

Exit

26

P a g e | 27

27

P a g e | 28

FIRST
LEVEL
DIAGRAM

DATA

FLOW

OF
DATA BASE SECTION

ADD

EDIT

DELETE
DATA BASE
SECTION

RETURN TO
PREVIOUS MENU

DISPLAY ALL

28

P a g e | 29

FIRST LEVEL DATA FLOW


DIAGRAM FOR SEARCHING
SECTION

SEARCH
BY
VEHICLE
NUMBER

SEARCHING
SECTION

SEARCH
BY CITY

29

P a g e | 30

CODING OF PROJECT
//=============
INFORMATION=============

GENERAL

VEHICLE MANAGEMENT SYSTEM


DEVELOPED BY GITESH GUPTA, DEEPAK BHARDWAJ, ABHINAV
GUPTA & ABHINAV KAPOOR
B.tech 2nd year students

//=================HEADER
FILES================
#include<iostream.h>
#include<fstream.h>
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<string.h>
#include<dos.h>
#include<math.h>
#include<time.h>
#include<stdlib.h>
#include<bios.h>
#include<graphics.h>
//#include"pass.h"
#include"border.h"
//===============GLOBAL
VARIABLES===============
char ch;
int switch_flag=0;
void
void
void
void

back_screen();
start_screen();
error();
main_menu();

30

P a g e | 31

//==============CLASS
DECLERATION================
class veh
{
public:
char
name[20],f_name[20],p_add[30],bld_grp[3],dob[10],ht[3],id_ma
rk[10],cont_no[10],city[10],age[3];
char
v_model[10],v_num[10],rc_num[10],engine_num[10],c_num[10]
;
int pin;
int code;
fstream file;
ifstream fin;
ofstream fout;
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void

add_item();
edit_menu();
edit_num();
edit_data();
delete_item();
delete_num();
show_item();
display_current();
database_section();
searching_section();
search_code();
search_name();
search_place();
exit_sure();
open2read();
open2write();
write();
read();

}obj;
void veh::add_item()
{

31

P a g e | 32

textcolor(RED);
textbackground(WHITE);
open2write();
do{
clrscr();
border();
cout<<"\n Enter the Personal Information ";
cout<<"\n Name : ";
gets(name);
cout<<"\n Father Name: ";
gets(f_name);
cout<<"\n Permanent address : ";
gets(p_add);
cout<<"\n Age : ";
cin>>age;
cout<<"\n Blood group : ";
cin>>bld_grp;
cout<<"\n DOB:";
cin>>dob;
cout<<"\n ht:";
cin>>ht;
cout<<"\n Identification mark :";
cin>>id_mark;
cout<<"\n Contact number:";
cin>>cont_no;
cout<<"\n city:";
cin>>city;
cout<<"\n Pin :";
cin>>pin;
cout<<"\n Vehicle Model:";
cin>>v_model;
cout<<"\n Vehicle Number :";
cin>>v_num;
cout<<"\n RC number :";
cin>>rc_num;
cout<<"\n Engine number:";
cin>>engine_num;
cout<<"\n Chasee number :";
write();
cout<<"\n \t\t Press 'Y' to add more Entery ";
ch=toupper(getche());
}while(ch=='Y');

32

P a g e | 33

}
// Function to display item
void veh::show_item()
{
textcolor(WHITE);
textbackground(BLACK);
clrscr();
border();
open2read();
int i=7;
gotoxy(15,3);
cout<<"Database Information";
while(!fin.eof())
{
read();
gotoxy(5,i++);cout<<"Details of the Person ";
gotoxy(5,i++);cout<<"Name : ";
puts(name);
gotoxy(5,i++);cout<<"Father's Name : "<<f_name;
gotoxy(5,i++);cout<<"Age : "<<age;
gotoxy(5,i++);cout<<"Permanent address :"<<p_add;
gotoxy(5,i++);cout<<" Blood group:"<<bld_grp;
gotoxy(5,i++);cout<<" dob:"<<dob;
gotoxy(5,i++);cout<<" Height:"<<ht;
gotoxy(5,i++);cout<<" Identification mark :"<<id_mark;
gotoxy(5,i++);cout<<" Contact number:"<<cont_no;
gotoxy(5,i++);cout<<" City"<<city;
gotoxy(5,i+
+);cout<<"===============================
=========================";
gotoxy(5,i++);cout<<" Vehicle information";
gotoxy(5,i++);cout<<" Vehicle Model:"<<v_model;
gotoxy(5,i++);cout<<" Vehicle Number:"<<v_num;
gotoxy(5,i++);cout<<" RC Number:"<<rc_num;
gotoxy(5,i++);cout<<" Engine number:"<<engine_num;
gotoxy(5,i++);cout<<" Chaesee Number:"<<c_num;
i++;
getch();
fflush(stdin);
}

33

P a g e | 34

}
// to display start screen
void main()
{
veh obj;
border();
start_screen();
//pass();
border();
main_menu();
}
// End of main()
void veh::exit_sure()
{
clrscr();
border();
gotoxy(25,15);
cout<<" Are you surely wanna quit.........";
ch=toupper(getche());
if(ch=='Y')
{
cout<<"\n\n\n \t\t\t\t\t GOOD BYE "
"\n \t\t\t\t SEE YOU SOON AGAIN";
delay(1000);
exit(0);
}
}

// function data base section


void veh::database_section()
{
int i=0;
do{
textcolor(RED);
textbackground(WHITE);

34

P a g e | 35

clrscr();
border();
gotoxy(25,4);
cout<<":::::: List of Operations :::::::";
gotoxy(10,6); cout<<" 1. Add new item.";
gotoxy(10,7); cout<<" 2. Edit Data in Database.";
gotoxy(10,8); cout<<" 3. Display all records.";
gotoxy(10,9); cout<<" 4. Delete Record from Database.";
gotoxy(10,10);cout<<" M. Return to main menu.";
ch=getche();
switch(ch)
{
case '1': add_item();
break;
case '2': edit_menu();
break;
case '3': show_item();
break;
case '4': delete_item();
break;
case 'M':
case 'm': i=1;
break;
default: error();
}
}while(i!=1);
}
}
void veh::delete_item()
{
textcolor(BLACK);
clrscr();
border();
gotoxy(25,5); cout<<" DELETE MENU";
gotoxy(5,8); cout<<"Delete by Vehicle number.";
delete_num();
}

35

P a g e | 36

//====================EDITING============
=====
void veh::edit_menu()
{
textcolor(BLACK);
clrscr();
border();
gotoxy(25,5); cout<<" EDIT MENU";
edit_num();
}
void start_screen()
{
clrscr();
textcolor(RED);
textbackground(WHITE);
clrscr();
border();
gotoxy(25,15);cout<<" Welcome To ";
gotoxy(25,20);cout<<" Vehicle Management System ";
delay(2000);
}
void veh::edit_num()
{
int j=0,len;
char temp[20];
char enume[20];
ofstream tfile;
tfile.open("temp.txt",ios::out|ios::binary);
border();
gotoxy(5,5); cout<<" Enter the vehicle number to be editted
";
gets(enume);
len=strlen(enume);
for(int k=0;k<len;k++)
{
temp[k]=toupper(ename[k]);

36

P a g e | 37

}
strcpy(enume,temp);
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj)))
{
j=strcmp(enume,v_num);
if(j==0)
{
edit_data();
tfile.write((char*)&obj,sizeof(obj));
}
else
tfile.write((char*)&obj,sizeof(obj));
}
remove("product.txt");
rename("product.txt","temp.txt");
}

//=============delete
number==============

by

vehicle

void veh::delete_num()
{
int j=0,len;
char temp[20];
char enume[20];
ofstream tfile;
tfile.open("temp.txt",ios::out|ios::binary);
border();
gotoxy(5,5); cout<<" Enter the Vehicle number to be deleted
";
gets(enume);

37

P a g e | 38

len=strlen(enume);
for(int k=0;k<len;k++)
{
temp[k]=toupper(enume[k]);
}
strcpy(enume,temp);
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj)))
{
j=strcmp(enume,v_num);
if(j==0)
{
continue;
}
else
tfile.write((char*)&obj,sizeof(obj));
}
remove("product.txt");
rename("product.txt","temp.txt");
}
void error()
{
textcolor(RED);
textbackground(WHITE);
clrscr();
border();
gotoxy(25,16);cout<<"Wrong Data entered ";
gotoxy(25,18);cout<<"Please Check Again";
gotoxy(25,17);
cout<<"Enter correct Data.";
for(int s=1;s<=10;s++)
{

38

P a g e | 39

sound(s*1000);
delay(50);
nosound();
sound(s*2000);
delay(30);
nosound();
}
}
//================
data================

===to

edit

void veh::edit_data()
{
border();
cout<<" Record found ";
cout<<" Enter Revised Data ";
cout<<" Name :"; puts(name); cout<<" : "; gets(name);
cout<<"Father's Name : ";cout<<f_name<<" :
";cin>>f_name;
cout<<"\n Permanent Address
: "<<p_add<<" : "
;cin>>p_add;
cout<<"\n Blood group : "<<bld_grp<<" : ";
cin>>bld_grp;
cout<<"\n Height : "<<ht<<" : ";cin>>ht;
cout<<"\n Identification mark : "<<id_mark<<"
:
";cin>>id_mark;
cout<<"\n Contact number : "<<cont_no<<"
:
";cin>>cont_no;
cout<<"\n City : "<<city<<" : ";cin>>city;
cout<<"\n Age : "<<age<<" : ";cin>>age;
cout<<"\n pin : "<<pin<<" : ";cin>>pin;
cout<<"\n
Vehicle
model
:
"<<v_model<<"
:
";cin>>v_model;
cout<<"\n Vehicle number : "<<v_num<<" : ";cin>>v_num;
cout<<"\n RC number : "<<rc_num<<" : ";cin>>rc_num;
cout<<"\n Engine numebr : "<<engine_num<<"
:
";cin>>engine_num;
cout<<"\n Chaesee number : "<<c_num<<" : ";cin>>c_num;

39

P a g e | 40

}
void veh::open2read()
{
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0);
}
void veh::open2write()
{
fout.open("product.txt",ios::app|ios::out|ios::binary);
}
void veh::write()
{
fout.write((char*)&obj,sizeof(obj));
}
void veh::read()
{
fin.read((char*)&obj,sizeof(obj));
}
//=====================================
======
// SEARCH SECTION
//=====================================
======
void veh::searching_section()
{
do {
clrscr();
border();
cout<<"\n Please enter your choice......";
cout<<"\n \t\t 1. Search by name.";

40

P a g e | 41

cout<<"\n \t\t 2. Search by place.";


cout<<"\n \t\t 3. Search by Vehicle number.";
cout<<"\n \t\t R. Return to previous menu.";
cout<<"\n \t\t E. Exit from program.";
ch=getche();
switch(ch)
{
case '1': search_place();
break;
case '2': search_name();
break;
case'3': search_code();
break;
case 'r':
case 'R':
break;
case 'e':
case 'E':
exit_sure();
break;
}
}while(ch!='r'||ch!='R');
}
// search by name
void veh::search_name()
{
int j=0,len;
char temp[20];
char sname[20];
border();
gotoxy(5,5); cout<<" Enter name of owner to be searched :
";
gets(sname);
len=strlen(sname);
for(int k=0;k<len;k++)
{

41

P a g e | 42

temp[k]=toupper(sname[k]);
}
strcpy(sname,temp);
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj)))
{
j=strcmp(sname,name);
if(j==0)
{
display_current();
break;
}
}
}
//================
place=================

search

by

void veh::search_place()
{
int j=0,len;
char temp[20];
char sname[20];
border();
gotoxy(5,5); cout<<" Enter name of Place to be searched :
";
gets(sname);
len=strlen(sname);
for(int k=0;k<len;k++)
{
temp[k]=toupper(sname[k]);
}
strcpy(sname,temp);

42

P a g e | 43

fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj)))
{
j=strcmp(sname,place);
if(j==0)
{
display_current();
break;
}
}
}
//===============Search
number============

by

void veh::search_code()
{ int j=0,len;
char temp[20];
char vnume[20];
border();
gotoxy(5,5); cout<<" Enter the Vehicle number
searched : ";
gets(vnume);
len=strlen(vnume);

vehicle

to be

for(int k=0;k<len;k++)
{
temp[k]=toupper(vnume[k]);
}
strcpy(vnume,temp);
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj)))
{
j=strcmp(vnume,place);
if(j==0)
{

43

P a g e | 44

display_current();
break;
}
}
}
void veh::display_current()
{
int i=5;
textcolor(GREEN);
textbackground(0);
clrscr();
border();
gotoxy(5,i+
+);cout<<"===============================
=========================";
gotoxy(5,i++);cout<<"Item code : "<<code;
gotoxy(5,i++);cout<<"Details of the item ";
gotoxy(5,i++);cout<<"Name : ";
puts(name);
gotoxy(5,i++);cout<<"Mrp of item : "<<mrp;
gotoxy(5,i++);cout<<"Our Price : "<<sp;
gotoxy(5,i+
+);cout<<"===============================
=========================";
getch();
}
//================
===================

main

menu

void main_menu(){
textcolor(WHITE);
textbackground(MAGENTA);
clrscr();
do {
clrscr();

44

P a g e | 45

// border1();
gotoxy(15,7); cout<<" Select a section to continue.......";
gotoxy(15,9); cout<<" [D] Database Section.";
gotoxy(15,10);cout<<" [S] Searching Section.";
gotoxy(15,11);cout<<" [E] Exit.";
ch=getche();
switch(ch)
{
case 'D':
case 'd': obj.database_section();
break;
case 'S':
case 's': obj.searching_section();
break;
case 'E':
case 'e': obj.exit_sure();
break;
default: error();
}
// if(switch_flag==1)
}while(ch!='e'||ch!='E');
}

45

P a g e | 46

BIBLIOGRAPHY:
1.

Object

Oriented

Programming

with

C++,

Balagurusamy .
2.

Programming in C, E Balagurusamy.

3.

System Analysis & Design, Elias M.Awad.

4.

Let Us C++, Yashwant Kanitkar

46

P a g e | 47

LIMITATIONS OF THE PROJECT

1. There is no data security, anyone can

access

the data.
2.

The

project

is

designed

for

standalone

computer and cant be run on any network.

47

You might also like