Professional Documents
Culture Documents
COMPUTER SCIENCE
PROJECT
Developed By
_________________________________
_____________________
1Page
Index
S.no. Description Page No.
1 Certificate 3
2 Acknowledgement & References 4-5
3 Introduction 6-7
4 Source Code 8-17
5 Output Screen 18-25
6 Hardware & Software requirement 26
2Page
Certificate
__________________
HOD, Computer Science
Date: ____________
3Page
Acknowledgement
I would like to express my sincere gratitude to my
computer teacher _____________ for her vital
support, guidance and encouragement without which this
project would not come forth from my side. Who helped
me completing the project by giving ideas, thoughts and
made this project easy and accurate.
4Page
Reference
1. www.tutorialspoint.com
2. www.cplusplus.com
5Page
INTRODUCTION
6Page
Binary.dat – It stores the basic details of the customer
which includes the following:
• Contact No
• Age
• Name
• Destination
• Name Of Airlines
7Page
SOURCE
CODE
8Page
#include<fstream.h>
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
class file
{
char cno[11];
int age;
char name[30];
char dest[20];
char airway[20];
public:
void input();
void show();
char *getn()
{
return name;
}
};file fileobj;
void file::input()
{
cout<<"Enter your mobile number: ";
cin>>cno;
cout<<"Enter your age: ";
cin>>age;
cout<<"Enter your name: ";
gets(name);
cout<<"Enter your destination: ";
gets(dest);
cout<<"Enter the Airways: ";
gets(airway);
}
void file::show()
{
cout<<"Contact Number==> "<<cno<<endl;
cout<<"Age ==> "<<age<<endl;
cout<<"Name==> "<<name<<endl;
cout<<"Destination==> "<<dest<<endl;
9Page
cout<<"Airways==> "<<airway<<endl;
}
void Create();
void Add();
void Display(); //display all
void DisplayP(); //display a particular record
void Modify();
void Delete();
fstream fil;
void box()
{
gotoxy(14,2);
cout<<"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»";
gotoxy(14,3);
cout<<"º";
gotoxy(56,3);
cout<<"º";
gotoxy(14,4);
cout<<"º";
gotoxy(56,4);
cout<<"º";
gotoxy(14,5);
cout<<"º";
gotoxy(56,5);
cout<<"º";
gotoxy(14,6);
cout<<"º";
gotoxy(56,6);
cout<<"º";
gotoxy(14,7);
cout<<"º";
gotoxy(56,7);
cout<<"º";
gotoxy(14,8);
cout<<"º";
gotoxy(56,8);
cout<<"º";
gotoxy(14,9);
cout<<"º";
gotoxy(56,9);
cout<<"º";
gotoxy(14,10);
10 P a g e
cout<<"º";
gotoxy(56,10);
cout<<"º";
gotoxy(14,11);
cout<<"º";
gotoxy(56,11);
cout<<"º";
gotoxy(14,12);
cout<<"º";
gotoxy(56,12);
cout<<"º";
gotoxy(14,13);
cout<<"º";
gotoxy(56,13);
cout<<"º";
gotoxy(14,14);
cout<<"º";
gotoxy(56,14);
cout<<"º";
gotoxy(14,15);
cout<<"ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ";
}
void startup()
{
box();
gotoxy(17,4);
cout<<" AIRPLANE DATABASE SYSTEM";
gotoxy(19,6);
cout<<"MADE BY: ";
gotoxy(19,8);
cout<<"_________________________________ ";
gotoxy(19,10);
cout<<"CLASS: XII Science";
}
void menu()
{
int opt;
while(1)
{
clrscr();
cout<<"MAIN MENU"<<endl;
cout<<"============================"<<endl;
11 P a g e
cout<<"1.Create Data File"<<endl;
cout<<"2.Display Record From Data File"<<endl;
cout<<"3.Display Particular Record From Data File"<<endl;
cout<<"4.Modify Paricular Record From Data File"<<endl;
cout<<"5.Delete Particular Record From Data File"<<endl;
cout<<"6.Exit From the Program"<<endl;
cout<<"Enter your Option : "<<endl;
cin>>opt;
switch(opt)
{
case 1:
clrscr();
Create();
cout<<"Display Main Menu"<<endl;
getch();
break;
case 2:
clrscr();
Display();
cout<<"Display Main Menu"<<endl;
getch();
break;
case 3:
clrscr();
DisplayP();
cout<<"Display Main Menu"<<endl;
getch();
break;
case 4:
clrscr();
Modify();
cout<<"Display Main Menu"<<endl;
getch();
break;
case 5:
12 P a g e
clrscr();
Delete();
cout<<"Display Main Menu"<<endl;
getch();
break;
case 6:
exit(0);
default:
}
}
}
void main()
{
clrscr();
startup();
delay(4000);
menu();
getch();
}
13 P a g e
}
fil.close();
}
while(fil.read((char*)&fileobj, sizeof(fileobj)))
{
fileobj.show();
cout<<"Press Any Key....For Next Record"<<endl;
cout<<"========================"<<endl;
getch();
}
}
fil.close();
}
14 P a g e
while(!fil.eof())
{
if(strcmp(n,fileobj.getn())==0)
{
fileobj.show();
cout<<"Press Any Key...."<<endl;
getch();
}
else
{
cout<<"Press Any Key....For Search"<<endl;
getch();
}
fil.read((char*)&fileobj, sizeof(fileobj));
}
}
fil.close();
}
void Modify() //Function to Modify Particular Record from Data File
{
char n[30];
cout<<"Enter Name that should be searched:";
gets(n);
cout<<endl;
cout<<"============================"<<endl;
fil.open("binary.dat",ios::in| ios::out|ios::binary);
if(!fil)
{
cout<<"File not Found";
exit(0);
}
else
{
fil.read((char*)&fileobj, sizeof(fileobj));
while(!fil.eof())
{
if(strcmp(n,fileobj.getn())==0)
{
fil.seekg(0,ios::cur);
cout<<"Enter New Record.."<<endl;
fileobj.input();
fil.seekp(fil.tellg() - sizeof(fileobj));
fil.write((char*)&fileobj, sizeof(fileobj));
}
15 P a g e
else
{
cout<<"Press Any Key....For Search"<<endl;
getch();
}
fil.read((char*)&fileobj, sizeof(fileobj));
}
}
fil.close();
}
while(fil.read((char*)&fileobj, sizeof(fileobj)))
{
if(strcmp(n,fileobj.getn())!=0)
{
o.write((char*)&fileobj, sizeof(fileobj));
}
else
{
flag=1;
}
fil.read((char*)&fileobj, sizeof(fileobj));
}
}
o.close();
fil.close();
if(flag==1)
16 P a g e
{
cout<<"This Record has been Deleted"<<endl;
getch();
}
else
{
cout<<"No such Record Exists"<<endl;
}
remove("binary.dat");
rename("new.dat", "binary.dat");
}
17 P a g e
Output
18 P a g e
Project: AIRWAYS Developed By: _________________________________
19 P a g e
Main menu
20 P a g e
Option 1: create data file
21 P a g e
Option 2: Display all records
from data file
22 P a g e
OPTION 3: DISPLAY PARTICULAR RECORD
FROM DATA FILE
23 P a g e
OPTION 4: MODIFY PARTICULAR RECORD
FROM DATA FILE
24 P a g e
OPTION 5: DELETE PARTICULAR RECORD
FROM DATA FILE
25 P a g e
Hardware & Software
Requirement
Hardware Requirement:
26 P a g e