Professional Documents
Culture Documents
Project Report On Vehicle Management System
Project Report On Vehicle Management System
SUBMITTED BY:
SUBMITTED TO:
Ms.
LECTURER CSE/IT
SUNITA
Page |2
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.
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
Page |6
INTRODUCTION
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
Page |8
LANGUAGE SELECTION
using
C++
language
which
supports
object
Data Encapsulation.
2.
3.
Automatic initialization.
4.
Operator Overloading.
Page |9
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
P a g e | 10
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
No. of bytes
Char
character
Int
integer
Float
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
>=
<=
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
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
Class
Contents
Filebuf
fstreambase
Provides operation common to the file
streams. Serves as base for fstream,
ifstream and ofstream class. Contains
open() and close() function.
Ifstream
Ofstream
Fstream
17
P a g e | 18
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
P a g e | 19
ios::trunc
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
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?
P a g e | 23
23
P a g e | 24
FUNCTION SYMBOL:
P a g e | 25
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
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.
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
SEARCH
BY
VEHICLE
NUMBER
SEARCHING
SECTION
SEARCH
BY CITY
29
P a g e | 30
CODING OF PROJECT
//=============
INFORMATION=============
GENERAL
//=================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);
}
}
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
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.
4.
46
P a g e | 47
access
the data.
2.
The
project
is
designed
for
standalone
47