Project Report On Vehicle Management System
Project Report On Vehicle Management System
ACKNOWLEDGEMENT
2
Page |
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
Page |
CANDIDATE DECLARATION
4
Page |
PROJECT SELECTION
5
Page |
INTRODUCTION
6
Page |
REQUIREMENTS
HARDWARE REQUIREMENTS:
SOFTWARE REQUIREMENTS:
7
Page |
LANGUAGE SELECTION
1. Data Encapsulation.
2. Data hiding and Access Mechanism.
3. Automatic initialization.
4. Operator Overloading.
8
Page |
BENEFITS OF OOPS:
FEATURES OF OOPS:
9
Page |
//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
1
Page |
Char 1 character
Int 2 integer
Float 4 floating point no.
OPERATORS:
Arithmetic operators:
Relational operators:
Operator Meaning
> greater than
< less than
== equal to
!= not equal to
1
Page |
LOGICAL OPERATORS:
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:
1
Page |
ACCESS SPECIFIERS:
OBJECT:
CONSTRUCTORS:
DESTRUCTORS:
1
Page |
OPERATOR OVERLOADING:
INHERITANCE:
Types of inheritance:
Single Inheritance
1
Page |
Multiple Inheritance
Hierarchical Inheritance
Multilevel Inheritance
Hybrid Inheritance
POLYMORPHISM:
Virtual Function:
Dynamic Binding:
Encapsulation:
Data Abstraction:
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.
1
Page |
Class Contents
Filebuf Its purpose is to set the file buffer to
read and write. Contains close() and
open() as members.
fstreambaseProvides 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
1
Page |
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.
1
Page |
FEASIBILITY STUDY
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:
1
Page |
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.
2
Page |
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.
2
Page |
DESIGN PHASE
2
Page |
2
Page |
FUNCTION SYMBOL:
2
Page |
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.
2
Page |
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.
Ex
it
2
Page |
2
Page |
ADD
EDIT DELETE
DATA BASE SECTION
DISPLAY ALL
2
Page |
SEARCHING SECTION
2
Page |
CODING OF PROJECT
//============= GENERAL
INFORMATION=============
//=================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();
3
Page |
//==============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()
{
3
Page |
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');
3
Page |
}
// 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();
3
Page |
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);
}
void veh::database_section()
{
int i=0;
do{
textcolor(RED);
textbackground(WHITE);
3
Page |
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();
}
3
Page |
//====================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]);
3
Page |
}
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 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); cout<<" Enter the Vehicle number to be deleted
";
gets(enume);
3
Page |
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++)
{
3
Page |
sound(s*1000);
delay(50);
nosound();
sound(s*2000);
delay(30);
nosound();
void veh::edit_data()
{
border();
3
Page |
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.";
4
Page |
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++)
{
4
Page |
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;
}
}
}
//================ search by
place=================
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);
4
Page |
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 by vehicle
number============
void veh::search_code()
{ int j=0,len;
char temp[20];
char vnume[20];
border();
gotoxy(5,5); cout<<" Enter the Vehicle number to be
searched : ";
gets(vnume);
len=strlen(vnume);
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)
{
4
Page |
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();
void main_menu(){
textcolor(WHITE);
textbackground(MAGENTA);
clrscr();
do {
clrscr();
4
Page |
// 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');
4
Page |
BIBLIOGRAPHY:
Balagurusamy .
2. Programming in C, E Balagurusamy.
4
Page |
the data.