0% found this document useful (0 votes)
227 views47 pages

Project Report On Vehicle Management System

The document is a project report on a Vehicle Management System created by four students as part of their Bachelor of Technology degree. It outlines the hardware and software requirements for the project, explains why C++ was selected as the programming language, and provides an introduction to the features and structure of a basic C++ program. The report includes sections on requirements, language selection, and the fundamentals of the C++ programming language.

Uploaded by

Beghin Bose
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
227 views47 pages

Project Report On Vehicle Management System

The document is a project report on a Vehicle Management System created by four students as part of their Bachelor of Technology degree. It outlines the hardware and software requirements for the project, explains why C++ was selected as the programming language, and provides an introduction to the features and structure of a basic C++ program. The report includes sections on requirements, language selection, and the fundamentals of the C++ programming language.

Uploaded by

Beghin Bose
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

PROJECT REPORT O N

VEHICLE M A N A G E M E N T S Y S T E M

SUBMITTED A S A PART OF PROJECT FOR THE BACHELOR OF


TECHONOLOGY IN COMPUTER SCIENCE A N D ENGINEERING

S U B M I T T E D BY: S U B M I T T E D TO:

ABHINAV GUPTA (101/06) Ms.


NAGRA SUNITA

ABHINAV KAPOOR (102/06) LECTURER CSE/IT


DEPT.

DEEPAK BH AR D W AJ (111/06)

GITESH GUPTA (117/06)


Pag e |2

DEPARTMENT OF COMPU TER SCIENCE A N D ENGINEERING

I N S T I T U T E O F E N G I N E E R I N G A N D E M E R G I N G T ECHNOLOGY,

B A D D I DI STT. S O L A N (H.P.)

A C K NO W L ED G E ME NT

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 ‘ M s . Sunita’,


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

2
Pag e |
3

TABLE OF CONTENTS

 Acknowledgement 02

 Candidate Declaration 04

 Project Selection 05

 Introduction 06

 Requirements 07

 Language Selection 08

 Feasibility Study 19

 Design Phase 22

 Coding Of Project 26

 Bibliography 42

 Limitations Of Project 43

3
Pag e |
4

CANDIDATE DECLARATION

It is here by certified that the work which is being


presented here, V E H I C L E M A N A G E M E N T S Y S T E M 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

4 TH Semester as part of the S y s t e m An a l y s i s A n d


D e s i g n project work, under the supervision of

Ms. Sunita Nagra

Lect. CSE/IT Dept.

4
Pag e |
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.

5
Pag e |
6

INTRODUCTION

The project ‘Vehicle M a n a g e m e n t S y s t e m ’ 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.

6
Pag e |
7

REQ U IREMENT S

A computer system with the following specifications:

H A R DW A RE REQUIREMENTS:

 1 0 0 M B Hard Disk
 2 5 6 M B RAM
 D V D R/W
 VGA Monitor
 1 1 0 Keys Keyboard
 Optical Mouse
 Printer

SOFTWARE REQUIREMENTS:

 Operating System (Windows XP/Vista)


 MS- Office
 Turbo C/C+ + Compiler

7
Pag e |
8

LANGUAGE SELECTION

In our project V E H I C L E M A N A G E M E N T S Y S T E M 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
O O PS 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.

8
Pag e |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.
 Datastructure 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.

9
P a g e | 10

 Objects m ay 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 mes s ag e 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.

F U N D A M E N T A L D A T A TYP E S:

D a t a type No. of b y t e s U s e d for r epres en ti n g

Char 1 character
Int 2 integer
Float 4 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.

Relat ional operators:

Operator Meaning
> greater than
< less than
== equal to
!= not equal to

11
Pag e |
12

>= greater than or equal to


<= less tan or equal to

LOGICAL OPERATORS:

1.A N D ( & & ) : 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.

A C C E S S 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 s ame as the
class name.

DESTRUCTORS:

A destructor is used to destroy the objects that have


been created by a constructor. Its name is s ame as
constructor but it starts with a tilde ( ~ ) sign.

13
Pag 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 oper ator 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.

T y p e s of inheritance:

 Single Inheritance

14
Pag e |
15

 Multiple Inheritance
 Hierarchical Inheritance
 Multilevel Inheritance
 Hybrid Inheritance
POLYMORPHISM:

A property by which we can send the s ame mes sag e to


the object of several different classes, and each object
can respond in different way depending on its class. We
can send such a mes sag e 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.

D y n a m i c Bi ndi ng:

It means that the code associated with a given


procedure call is not known until the time of call at run-
time.

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
Pag e |
16

D a t a 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
Pag e |
17

D et a i l s Of S t r e a m C l a s s e s :

Class C on ten ts
Filebuf Its purpose is to set the file buffer to
read and write. Contains close( ) and
o p e n ( ) as members.
f s t r e a m b a s eProvides operation common to the file
streams. Serves as base for fstream,
i fstr eam and o f s t r e a m class. Contains
o p e n ( ) and close() function.

I fst r eam Provides input operations. Contains


input() mode. Inherits the function get(),
getlin e( ), read( ),seekg() and tellg() func tions
from istream.
O f st r e a m Provides output operations. Contains
open() mode. Inherits the function
put(),write(),seekp() and tellp() functions
from ostream.
F s t r ea m 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 i s t r e a m and o s t r e a m classes
through iostream.

Fu n ct i on s For M a n i p u l a t i o n of File Pointers:

s e e k g ( )moves get pointer(i/p) to a specific location.


s eek p( )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 M o d e s :

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::noreplac eOpen fails if file already exists.
ios::out Open file for writing only.

18
Pag 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:
1. What is the user’s need?
2.What resources are available for given candidate
system?
3.What is the likely impact of the candidate system
on the organization?
Threeconsideration are involved in feasibility
analysis, Economical, Technical and Operational?

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 system may
vary considerably, but might include:

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.

Econ omi c al 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.

Operati on al 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
Pag e |
21

SYSTE M 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
Pag e |
22

D E S I G N PHASE

The most creative and challenging phase of SYSTEM


DEVLOPMENT LIFE CYCLE is S Y S T E M D E S I G N . 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: H O W THE PROBLEM SHOULD
BE
S O LV E D ?

D e s i g n P h a s e i s basi cally of t w o types:

 Traditional Design Phase


 Object-Oriented Design Phase

But we normally follow the traditional design in the form


of D F D s …

22
Pag e |
23

DATA FLOW DIAGRAMS:


D F D 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. D F D s 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 S y m b o l s U s e d for C o n s t r u c t i n g D F D s :

23
Pag 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).

E X T E R N A L E N TITY S Y M B O L :

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
Pag 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 D F D M O D E L OF A S Y S T E M
To develop a higher-level D F D model, process a
decomposed into their sub-processes and the data flow
amo ng 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 D F D s 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 Data Base


Section Section

Vehicle
Management
System

Exit

26
Pag e |
27

27
Pag e |
28

FIRST LEVEL DATA FLOW


DIAGRAM
OF
DATA
BASE
SECTION

ADD

EDIT DELETE
DATA BA SE
SECTION

RETURN TO
PREVIOUS MENU

DISPLAY ALL

28
Pag e |
29

FIRST LEVEL DATA FLOW


DIAG RAM FOR SEARCHING
SECTION

SE ARCH
BY SEARCH
VEHICLE SEARCHING BY CITY
N UM BE R SECTION

29
Pag e |
30

C O D ING OF PROJECT
//============= GENERAL
INFORMATION=============

VEHICLE MAN AG EMEN T SYSTEM


DE VELOPED BY GITESH GUPTA, DEEPAK BH AR D W AJ, 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 back_screen();
void start_screen();
void error();
void main_menu();

30
Pag 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 add_item();
void edit_menu();
void edit_num();
void edit_data();
void delete_item();
void delete_num();
void show_item();
void display_current();
void database_section();
void searching_section();
void search_code();
void search_name();
void search_place();
void exit_sure();
void open2read();
void open2write();
void write();
void read();

}obj;

void veh::add_item()
{

31
P a g e | 32

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

32
Pag e |
33

}
// Function to display item

void veh::show_item()
{
textcolor(WHITE);
textbackground(BLACK);
clrscr();
border();
open2read();
int i=7;
gotoxy(15,3);
c o u t << " D a ta ba s e Information";
while(!fin.eof())
{
read();

gotoxy(5,i++);cout<<"Details of the Person ";


goto xy(5,i++); cout<<"Name : ";
puts(name);
gotoxy(5,i++);cout<<"Father's N ame : "<<f_name;
goto xy(5,i++); cout<<"Ag e : " < < a g e ; gotoxy(5,i+
+);cout<<"Permanent address :"<<p_add; goto xy(5, i+
+);co ut<<" Blood group:"<<bld_grp; g oto xy(5, i+
+);co ut<<" dob:"<<dob; g oto xy(5, i++) ;cou t<<"
Height:"<<ht; g otox y(5,i++);co ut<<" Identification
mark :"<<id_mark; goto xy(5,i++); cout<<" Contact
number:"<<cont_no; g oto xy(5, i++) ;cou t<<"
City"<<city;
gotoxy(5,i+
+);cout<<"===========================
====
=========================";
goto xy(5,i++); cout<<" Vehicle information";
goto xy(5,i++); cout<<" Vehicle Model:"<<v_model;
goto xy(5,i++); cout<<" Vehicle Number:"<<v_num;
goto xy(5,i++); cout<<" RC Number:"<<rc_num;
goto xy(5,i++); cout<<" Engine number:"<<engine_num;
goto xy(5,i++); cout<<" Chaesee Number:"<<c_num; i +
+;
getch();
fflush(stdin);
}

33
Pag 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);
c o u t < < " Are you surely wanna quit.........";
ch=toupper(getche());
if(ch=='Y')
{
cout<<"\n\n\n \t\t\t\t\t G O O D BYE " "\
n \t\t\t\t S E E YOU S O O N AGAIN";
delay(1000);
exit(0);
}

}
// function data base section

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

34
Pag e |
35

clrscr();
border();
gotoxy(25,4); cout<<":::::: List of Operations :::::::";
gotoxy(10,6); c o u t < < " 1. Add new item.";
gotoxy(10,7); c o u t < < " 2. Edit Data in Database.";
gotoxy(10,8); c o u t < < " 3. Display all records.";
gotoxy(10,9); c o u t < < " 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); c o u t < < " DELETE MENU";
gotoxy(5,8); cou t<<"D el ete by Vehicle number.";

delete_num();
}
35
P a g e | 36

//====================EDITING============
=====

void veh::edit_menu()
{
textcolor(BLACK);
clrscr();
border();
gotoxy(25,5); c o u t < < " EDIT MENU";
edit_num();

void start_screen()
{
clrscr();
textcolor(RED);
textbackground(WHITE);
clrscr();
border();
gotoxy(25,15);cout<<" To ";
Welcome
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); c o u t < < " 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
Pag 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= s trcmp(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 by vehicle
number==============

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); c o u t < < " Enter the Vehicle
number to be deleted
";
gets(enume);

37
Pag e |
38

len=strlen(enume);

for(int k = 0 ; k < l e n ; 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= s trcmp(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<<"E n ter correct
Data."; for(int s = 1 ; s < = 1 0 ; s + + )
{
38
Pag e |
39

sound(s*1000);
delay(50);
nosound();
sound(s*2000);
delay(30);
nosound();

//================ ===to edit


data================

void veh::edit_data()
{
border();

c o u t < < " Record found ";


c o u t < < " Enter Revised Data ";
c o u t < < " N ame :"; puts(name); c o u t < < " : "; gets(name);
cout<<"Father's Name :
";cout<<f_name<<" :
";cin>>f_name;
c o u t < <" \ n Permanent Address :
"<<p_add<<" : "
;cin>>p_add;
c o u t< <" \ n Blood group : "<<bld_grp<<"
: "; cin>>bld_grp;
c o u t < < " \ n Height : " < < h t < < " : ";cin>>ht;
c o u t< <" \ n Identification mark : "<<id_mark<<"
: ";cin>>id_mark;
c o u t < <" \ n Contact number :
"<<cont_no<<" : ";cin>>cont_no;
c o u t < < " \ n City : " < < c i t y < < " : ";cin>>city;
c o u ot <u<t <<
c " \ n" \Age
n :Vehicle
" < < a g e < <model :
" : ";cin>>age;"<<v_model<<" :
";cin>>v_model;
c o u t < < " \ n pin : " < < p i n < < " : ";cin>>pin;
c o u t < < " \ n Vehicle number : " < < v _ n u m < < " : ";cin>>v_num;
c o u t < < " \ n R C number : " < < r c _ n u m < < " : ";cin>>rc_num;
c o u t < <" \ n Engine numebr : "<<engine_num<<" :
";cin>>engine_num;
c o u t < < " \ n Chaesee number : " < < c _ n u m < < " :
";cin>>c_num;

39
Pag 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));

//
==========================
===========
======
// SE A R CH SECTION
//
==========================
===========
======

void veh::searching_section()
{

do
{ clrscr
(); 40
border(
);
P a g e | 41

c o u t < < " \ n \t\t 2. Search by place.";


c o u t < < " \ n \t\t 3. Search by Vehicle number.";
c o u t < < " \ n \t\t R. Return to previous
menu."; c o u t < < " \ 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;

} w hile(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);
c o u t < < " Enter
name of owner
to be
searched :
";
gets(sname); 41
len=strlen(sname);
Pag 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= s trcmp(s name,name);
if(j= = 0)
{
display_current();
break;
}

}
}
//================ search by
place=================

void veh::search_place()
{

int j= 0,len;
char temp[20];
char sname[20];
border();
gotoxy(5,5);
c o u t < < " Enter
name of Place
to be
searched :
";
gets(sname);
len=strlen(sname);

for(int
k=0;k<len;k++)
{
temp[k]=toupper(
sname[k]);
} 42
Pag e |
43

fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);

while(file.read((char*)&obj,sizeof(obj)))
{
j= s trcmp(s name,place);
if(j= = 0)
{
display_current();
break;
}

}
}/ / = = = = = = = = = = = = = = = S e a r c h by vehicle
number============

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

for(int k = 0 ; k < l e n ; 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= s trcmp(vnum e,place);
if(j= = 0)
{

43
Pag 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 : " < < c o d e ;
gotoxy(5,i++);cout<<"Details of the item ";
goto xy(5,i++); cout<<"Name : ";
puts(name);
gotoxy(5,i++);cout<<"Mrp of item : " < < m r p ;
gotoxy(5,i++);cout<<"Our
/ / = = = = = = = = = = = = = = = = Price : " < < s p ;main menu
gotoxy(5,i+
= ==================
+);cout<<"====================
= = = =main_menu()
void =======
={ =textcolor(WHITE);
=======================";
getch();
textbackground(MAGENTA);
clrscr();
}do {

clrscr();

44
P a g e | 45

// border1();
gotoxy(15,7); c o u t < < " Select a section to continue.......";
gotoxy(15,9); c o u t < < " [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)

} w hile(ch! = ' e' ||ch!= ' E' );

45
Pag e |
46

BIBLIOGRAPHY:

1. Object Oriented Programming with C+


+, E

Balagurusamy .
2. Programming in C, E Balagurusamy.

3. System Analysis & Design, Elias M.Awad.

4. Let Us C + + , Yashwant Kanitkar

46
Pag e |
47

LIMITATIONS OF THE PROJECT

1. There is n o data security, a n y o n e can access

the data.

2. The project is de s i g n e d for standalon e

compu te r a n d can’t be run on a n y network.

47

You might also like