//============= GENERAL
INFORMATION=============
VEHICLE MANAGEMENT SYSTEM
DEVELOPED BY GITESH GUPTA, DEEPAK BHARDWAJ, ABHINAV GUPTA & ABHINAV KAPOOR
B.tech 2nd year students
//=================HEADER
//==============CLASS
textcolor(RED);
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 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');
}
// Function to display item void veh::show_item()
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;
}
// to display start screen void main()
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);
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();
void veh::delete_item() {
textcolor(BLACK);
clrscr();
border();
gotoxy(25,5); cout<<" DELETE MENU";
gotoxy(5,8); cout<<"Delete by Vehicle number.";
delete_num();
}
//====================EDITING============
gotoxy(25,5); cout<<" EDIT MENU";
edit_num();
}
void start_screen() {
gotoxy(25,15);cout<<" Welcome To ";
gotoxy(25,20);cout<<" Vehicle Management System ";
delay(2000);
tfile.open("temp.txt",ios::out|ios::binary);
border();
gotoxy(5,5); cout<<" Enter the vehicle number to be editted
";
}
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==============
tfile.open("temp.txt",ios::out|ios::binary);
border();
gotoxy(5,5); cout<<" Enter the Vehicle number to be deleted
";
gets(enume);
len=strlen(enume);
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);
tfile.write((char*)&obj,sizeof(obj));
}
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++) {
sound(s*1000);
cout<<" Enter Revised Data ";
cout<<" Name :"; puts(name); cout<<" : "; gets(name);
cout<<"Father's Name : ";cout<<f_name<<" :
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;
}
void veh::open2read() {
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0);
fout.write((char*)&obj,sizeof(obj));
}
void veh::read() {
fin.read((char*)&obj,sizeof(obj));
}
cout<<"\n Please enter your choice...";
cout<<"\n \t\t 1. Search by name.";
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();
// search by name
void veh::search_name()
gotoxy(5,5); cout<<" Enter name of owner to be searched :
";
gets(sname);
len=strlen(sname);
for(int k=0;k<len;k++) {
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);
fin.open("product.txt",ios::in|ios::app);
fin.seekg(0,ios::beg);
while(file.read((char*)&obj,sizeof(obj))) { j=strcmp(sname,place);
//===============Search by vehicle
number============
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) {
display_current();
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+
// 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');
}
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