SlideShare a Scribd company logo
Computer science
Investigatory project
Telephone directory
Submittedby:-ShubhamYadav
Submittedto:-Mr.PawanSihag
(PGTComputerScience)
Kendriya Vidayalaya No 1
Air Force Station Bhuj
This is to certify to be the bonafide work of
the Computer Laboratory by Shubham
Yadav of class XII-A has completed the
annual investigatory project in the
academic year 2017-2018 as per the
CBSE syllabus for computer science in
class XII in KENDRIYA VIDYALAYA NO.1
AFS BHUJ.
Sign of:
…………………………
A.P Rai
(Principal)
K.V. No.1 AFS BHUJ
CERTIFICATEOF AUTHENTICITY
This is to certify that Shubham Yadav, student of
class XII-A has successfully completed the
research project on the topic “Telephone
Directory” under the guidance of Mr. Pawan Sihag
(PGT Computer Science).
This project is absolutely genuine and does not
indulge in plagiarism of any kind. The references
taken in making this project have been declared in
the end of this project report.
Sign of: Sign of:
……………………….. ……………………….
Examiner (Mr. Pawan Sihag)
Kendriya Vidyalaya
No.1
Air Force Station, Bhuj
From the depth of my heart I express my
deep sincere gratitude to the almighty for the
blessing that had bestowed upon me to do
this work.
Firstly, I would like to thanks to our Principal
MR. A.P. RAI who gave us the opportunity to
present this project. Secondly our subject
teacher ‘MR. PAWAN SIHAG ‘who guided me
to do this project and under his supervision I
became capable of doing this project.
Whenever I found myself stuck he helped me
in solving my difficulties and cleared my
doubts regarding the topic.
Contents
HEADER FILES USED
1. iostream.h – for cin and cout
2. conio.h – for getch()
3. fstream.h – for file handling
4. iomanip.h – for setw()
5. stdio.h – for standard i/o operation
6. stdlib.h – for using exit function
files generated
 telephone.dat – for storing data
 telephone1.dat – for storing copied
data form telephone.dat in delete
function
e r diagram
source code
// program: Telephone Directory
// Made By:- Shubham Yadav
#include<fstream.h>
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
#include<process.h>
#include<iomanip.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
void welcome_screen()
{ clrscr();
gotoxy(15,11);
cout<<"(********************WELCOME********
************)";
gotoxy(15,14);
cout<<"( TELEPHONE MANAGEMENT SOFTWARE )";
getch();
{ gotoxy(25,20);
cout<<" Computer Science Project ";
}
gotoxy(38,25);
cout<<" M A D E B Y: ";
gotoxy(50,27);
cout<<" SHUBHAM YADAV ";
gotoxy(50,30);
cout<<" XII-A CS";
gotoxy(40,40);
cout<<"***Press any key to continue***";
cout<<"aaaaa";
getch();
return;
}
class directory
{ public:
int record;
long pn1;
char pn2[10];
int age;
char address1[50];
char address2[50];
char occupation[20];
char name[20];
char emailadd[40];
char internetadd[25];
void modification();
void addition();
void deleate();
void menu();
void search();
void view1();
void init();
void display();
void view();
char check(char *);
int test();
}obj;
void directory::addition() //ADDING INFORMATION
{ fstream fout;
fout.open("telephone.dat",ios::out|ios::app);
if(!fout)
{ cout<<"not able to open the file";
exit(0);
}
char ch='y';
while(ch=='y'||ch=='Y')
{ init();
fout.write((char*)&obj,sizeof(obj));
cout<<"one record added sucessfully";
cout<<"n Do you want enter more records ";
cin>>ch;
}
fout.close();
}
int directory::test() //FIND NO. OF RECORDS
{ fstream fin;
fin.open("telephone.dat",ios::in);
fin.seekg(0,ios::end);
int n;
n=fin.tellg()/sizeof(obj);
cout<<" n NUMBER OF RECORDS = "<<n;
return n;
}
void directory::search() //SEARCHING FOR A PARTICULAR
NUMBER
{ ifstream fin;
fin.open("telephone.dat",ios::in);
if (!fin)
{ cout<<"n FILE NOT FOUND ";
exit(0);
}
clrscr();
gotoxy(30,1);
cout<<" [SEARCHING] ";
cout<<" n ENTER PHONE NUMBERED TO BE
SEARCHED : ";
long pn;
cin>>pn;
int n;
n=test();
for (int i=0;i<n;i++)
{ fin.read((char*)&obj,sizeof(obj));
if (pn==pn1)
{ view1();
return;
}
}
if(fin.eof())
{ cout<<" n RECORD NOT FOUND ";
}
}
void directory::init() //ENTERING THE DETAILS
{ char c;
clrscr();
char ch;
gotoxy(30,1);
cout<<" [ADDITION] ";
cout<<"n ENTER HOUSE PHONE NUMBER (max 7
digits) :";
cin>>pn1;
cout<<"n ENTER MOBILE PHONE NUMBER (max 10
digits) :";
cin>>pn2;
cin.get(ch);
cout<<" n ENTER NAME : ";
cin.getline(name,20,'n');
cout<<" n ENTER HOUSE ADDRESS : ";
cin.getline(address1,50,'n');
cout<<"n ENTER EMAIL ADDRESS : ";
cin.getline(emailadd,40,'n');
cout<<"nnnnn Want to exit(Y/N) :";
cin>>c;
if (c=='Y'||c=='y')
exit(0);
}
void directory::view1() //TO DISPLAY ALL THE RECORDS
{ cout<<"n";
cout<<" PHONE NUMBER1 :"<<obj.pn1<<"n";
cout<<" PHONE NUMBER2 :"<<obj.pn2<<"n";
cout<<" NAME : "<<obj.name<<"n";
cout<<" HOUSE ADDRESS : "<<obj.address1<<"n";
cout<<" EMAIL ADDRESS : "<<obj.emailadd<<"n";
getch();
}
void directory::modification() //TO MODIFY ANY DATA IN
THE RECORD IF NECESSARY
{ clrscr();
gotoxy(30,1);
cout<<" [MODIFICATION] ";
long pn;
int n,i;
ifstream fin;
ofstream fout;
fin.open("telephone.dat");
if (fin.fail())
{ cout<<"n FILE NOT FOUND ! ";
fout.close();
exit(0);
}
fout.open("new");
n=test();
if (n==0)
{ cout<<"n FILE IS EMPTY ! ";
getch();
return;
}
while(fin.good())
{ fin.read((char*)&obj,sizeof(obj));
fout.write((char*)&obj,sizeof(obj));
}
fin.close();
fout.close();
fout.open("telephone.dat",ios::trunc);
fin.open("new");
if (fin.fail())
{ cout<<"n FILE NOT FOUND ! ";
exit(0);
}
char ch;
cout<<"n ENTER PHONE NUMBER : ";
cin>>pn;
ch=cin.get();
for(i=0;i<n;i++)
{ fin.read((char*)&obj,sizeof(obj));
char d;
if (pn==pn1)
{ view1();
d=check("MOBILE PHONE NUMBER");
if((d=='y')||(d=='Y'))
{cout<<"n ENTER NEW PHONE NUMBER:";
cin>>pn1;
ch=cin.get();
}
if(check("MOBILE PHONE NUMBER")=='Y')
{cout<<"n ENTER NEW PHONE NUMBER:";
cin>>pn2;
ch=cin.get();
cin.get(ch);
}
if(check("NAME")=='y')
{ cout<<"n ENTER NEW NAME :";
cin.getline(name,20,'n');
}
if(check("HOME ADDRESS")=='y')
{ cout<<"n ENTER NEW ADDRESS :";
cin.getline(address1,50,'n');
}
if(check("EMAIL ADDRESS")=='y')
{cout<<"n ENTER NEW EMAIL ADDRESS :";
cin.getline(emailadd,25,'n');
}
}
fout.write((char*)&obj,sizeof(obj));
}
}
char directory::check(char *s)
{ cout<<"n MODIFY t"<<s<<"t"<<"Y/N";
char ch;
ch=getch();
if((ch=='y')||(ch=='Y'))
return 'y';
else
return 'n';
}
void directory::deleate()
{ clrscr();
window(1,1,80,25);
gotoxy(30,1);
cout<<" [DELETION] ";
long pn;
int n,i;
ifstream fin;
ofstream fout;
fin.open("telephone.dat",ios::in);
if (fin.fail())
{ cout<<"n FILE NOT FOUND ! ";
getch();
return;
}
fout.open("new");
n=test();
if (n==0)
{ cout<<"n FILE IS EMPTY ";
getch();
return;
}
for(i=0;i<n;i++)
{ fin.read((char*)&obj,sizeof(obj));
fout.write((char*)&obj,sizeof(obj));
}
fin.close();
fout.close();
fout.open("telephone1.dat",ios::trunc);
fin.open("new");
if(fin.fail())
{ cout<<"n FILE NOT FOUND !";
getch();
return;
}
cout<<"n ENTER PHONE NUMBER :";
cin>>pn;
for(i=0;i<n;i++)
{ fin.read((char*)&obj,sizeof(obj));
if(pn!=pn1)
{ fout.write((char*)&obj,sizeof(obj));
}
}
fout.close();
fin.close();
}
void directory::view()
{ ifstream fin;
int n,j;
fin.open("telephone.dat",ios::in);
if(fin.fail()||fin.bad())
{ cout<<"n FILE NOT FOUND !";
getch();
return;
}
clrscr();
int i=0;
n=test();
for(j=0;j<n;j++)
{ cout<<"n RECORD"<<(i+1)<<"n";
fin.read((char*)&obj,sizeof(obj));
cout<<"n PHONE NUMBER1 :"<<obj.pn1<<"n";
cout<<"n PHONE NUMBER2 :"<<obj.pn2<<"n";
cout<<"n NAME :"<<obj.name<<"n";
cout<<"n HOUSE ADDRESS
:"<<obj.address1<<"n";
// cout<<"n OCCUPATION ADDRESS
:"<<obj.occupation<<"n";
// cout<<"n OFFICE ADDRESS :
"<<obj.address2<<"n";
// cout<<"n INTERNET ADDRESS :
"<<obj.internetadd<<"n";
cout<<"n EMAIL ADDRESS
:"<<obj.emailadd<<"n";
i+=1;
}
fin.close();
getch();
}
void directory::menu()
{ char ch;
clrscr();
gotoxy(20,3);
cout<<"TELEPHONE DIRECTORY: What You Want to
do?";
//textcolor(RED);
gotoxy(30,8);
cout<<" A: ADDITION";
gotoxy(30,11);
cout<<" D: DELETION nr";
gotoxy(30,14);
cout<<" M: MODIFICATION nr";
gotoxy(30,17);
cout<<" V: VIEW nr";
gotoxy(30,20);
cout<<" S: SEARCH nr";
gotoxy(30,23);
cout<<" E: EXIT nr";
ch=getch();
switch(ch)
{ case'a':
case'A': addition();
break;
case'd':
case'D': deleate();
break;
case'm':
case'M': modification();
break;
case'v':
case'V': view();
break;
case's':
case'S': search();
break;
case'e':
case'E': clrscr();
exit(0);
}
}
int main()
{ welcome_screen();
for(;;)
obj.menu();
return 0; }
output screen
1 welcome screen
2. operational screen
3. addition screen
4. screen after adding one record
5. view operation screen
6 search operation screen
7 screen after search operation
8 modification operation screen
9 screen after input in modification operation
10 screen after modification in modification operation
11. input in delete operation screen
12. view operation screen after deletion
Websites:-
www.wikipedia.com
www.icbse.com
www.csworld.com
Books:-
Computer Science
By- Sumita Arora
Subjectteacher:-
Mr. Pawan Sihag

More Related Content

What's hot

BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
SHAJUS5
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Rushil Aggarwal
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
siddharthjha34
 
Ip library management project
Ip library management projectIp library management project
Ip library management project
AmazShopzone
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
Darshit Vaghasiya
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
Nitesh Kushwaha
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12
Abhishek Sinha
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
Shahban Ali
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
D. j Vicky
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
Raunak Yadav
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
Self-employed
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
manishjain598
 
Informatics Practices Project on Tour and travels
 Informatics Practices Project on Tour and travels  Informatics Practices Project on Tour and travels
Informatics Practices Project on Tour and travels
Harsh Mathur
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
RemaDeosiSundi
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
Harsh Kumar
 
computer science project for class 12 on telephone billing
computer science project for class 12 on telephone billingcomputer science project for class 12 on telephone billing
computer science project for class 12 on telephone billing
anshi acharya
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
AkshatTiwari530170
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
Aman Deep
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
OmRanjan2
 

What's hot (20)

BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
Ip library management project
Ip library management projectIp library management project
Ip library management project
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
 
Informatics Practices Project on Tour and travels
 Informatics Practices Project on Tour and travels  Informatics Practices Project on Tour and travels
Informatics Practices Project on Tour and travels
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
computer science project for class 12 on telephone billing
computer science project for class 12 on telephone billingcomputer science project for class 12 on telephone billing
computer science project for class 12 on telephone billing
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 

Similar to C s investigatory project on telephone directory

project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
vikram mahendra
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
Mitul Patel
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
Kandarp Tiwari
 
Telephonedirectory (1)
Telephonedirectory (1)Telephonedirectory (1)
Telephonedirectory (1)
Abhay Modi
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
Syed Umair
 
Ronak Kachhawa , BCA Third Year
Ronak Kachhawa , BCA Third YearRonak Kachhawa , BCA Third Year
Ronak Kachhawa , BCA Third Year
Dezyneecole
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third Year
Dezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
Dezyneecole
 
Cmptr ass
Cmptr assCmptr ass
Cmptr ass
mohit273595
 
C PROGRAMS
C PROGRAMSC PROGRAMS
Durgesh
DurgeshDurgesh
Durgesh
dkbossverma
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
dezyneecole
 
CS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12thCS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12th
Sudhindra Mudhol
 
C++ file
C++ fileC++ file
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
dezyneecole
 
Python para equipos de ciberseguridad
Python para equipos de ciberseguridad Python para equipos de ciberseguridad
Python para equipos de ciberseguridad
Jose Manuel Ortega Candel
 
Computer
ComputerComputer
Computer
Yadav Amit
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
Jaydip JK
 

Similar to C s investigatory project on telephone directory (20)

project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
Telephonedirectory (1)
Telephonedirectory (1)Telephonedirectory (1)
Telephonedirectory (1)
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
Ronak Kachhawa , BCA Third Year
Ronak Kachhawa , BCA Third YearRonak Kachhawa , BCA Third Year
Ronak Kachhawa , BCA Third Year
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Cmptr ass
Cmptr assCmptr ass
Cmptr ass
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Durgesh
DurgeshDurgesh
Durgesh
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
CS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12thCS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12th
 
C++ file
C++ fileC++ file
C++ file
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
Python para equipos de ciberseguridad
Python para equipos de ciberseguridad Python para equipos de ciberseguridad
Python para equipos de ciberseguridad
 
Computer
ComputerComputer
Computer
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
 

Recently uploaded

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 

Recently uploaded (20)

ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 

C s investigatory project on telephone directory

  • 1. Computer science Investigatory project Telephone directory Submittedby:-ShubhamYadav Submittedto:-Mr.PawanSihag (PGTComputerScience)
  • 2. Kendriya Vidayalaya No 1 Air Force Station Bhuj This is to certify to be the bonafide work of the Computer Laboratory by Shubham Yadav of class XII-A has completed the annual investigatory project in the academic year 2017-2018 as per the CBSE syllabus for computer science in class XII in KENDRIYA VIDYALAYA NO.1 AFS BHUJ. Sign of: ………………………… A.P Rai (Principal)
  • 3. K.V. No.1 AFS BHUJ CERTIFICATEOF AUTHENTICITY This is to certify that Shubham Yadav, student of class XII-A has successfully completed the research project on the topic “Telephone Directory” under the guidance of Mr. Pawan Sihag (PGT Computer Science). This project is absolutely genuine and does not indulge in plagiarism of any kind. The references taken in making this project have been declared in the end of this project report. Sign of: Sign of: ……………………….. ………………………. Examiner (Mr. Pawan Sihag)
  • 4. Kendriya Vidyalaya No.1 Air Force Station, Bhuj From the depth of my heart I express my deep sincere gratitude to the almighty for the blessing that had bestowed upon me to do this work. Firstly, I would like to thanks to our Principal MR. A.P. RAI who gave us the opportunity to present this project. Secondly our subject teacher ‘MR. PAWAN SIHAG ‘who guided me to do this project and under his supervision I became capable of doing this project. Whenever I found myself stuck he helped me in solving my difficulties and cleared my doubts regarding the topic.
  • 6. HEADER FILES USED 1. iostream.h – for cin and cout 2. conio.h – for getch() 3. fstream.h – for file handling 4. iomanip.h – for setw() 5. stdio.h – for standard i/o operation 6. stdlib.h – for using exit function
  • 7. files generated  telephone.dat – for storing data  telephone1.dat – for storing copied data form telephone.dat in delete function e r diagram
  • 8. source code // program: Telephone Directory // Made By:- Shubham Yadav #include<fstream.h>
  • 10. cout<<" M A D E B Y: "; gotoxy(50,27); cout<<" SHUBHAM YADAV "; gotoxy(50,30); cout<<" XII-A CS"; gotoxy(40,40); cout<<"***Press any key to continue***"; cout<<"aaaaa"; getch(); return; } class directory { public: int record; long pn1; char pn2[10]; int age; char address1[50]; char address2[50]; char occupation[20]; char name[20];
  • 11. char emailadd[40]; char internetadd[25]; void modification(); void addition(); void deleate(); void menu(); void search(); void view1(); void init(); void display(); void view(); char check(char *); int test(); }obj; void directory::addition() //ADDING INFORMATION { fstream fout; fout.open("telephone.dat",ios::out|ios::app); if(!fout) { cout<<"not able to open the file"; exit(0); }
  • 12. char ch='y'; while(ch=='y'||ch=='Y') { init(); fout.write((char*)&obj,sizeof(obj)); cout<<"one record added sucessfully"; cout<<"n Do you want enter more records "; cin>>ch; } fout.close(); } int directory::test() //FIND NO. OF RECORDS { fstream fin; fin.open("telephone.dat",ios::in); fin.seekg(0,ios::end); int n; n=fin.tellg()/sizeof(obj); cout<<" n NUMBER OF RECORDS = "<<n; return n; }
  • 13. void directory::search() //SEARCHING FOR A PARTICULAR NUMBER { ifstream fin; fin.open("telephone.dat",ios::in); if (!fin) { cout<<"n FILE NOT FOUND "; exit(0); } clrscr(); gotoxy(30,1); cout<<" [SEARCHING] "; cout<<" n ENTER PHONE NUMBERED TO BE SEARCHED : "; long pn; cin>>pn; int n; n=test(); for (int i=0;i<n;i++) { fin.read((char*)&obj,sizeof(obj)); if (pn==pn1) { view1();
  • 14. return; } } if(fin.eof()) { cout<<" n RECORD NOT FOUND "; } } void directory::init() //ENTERING THE DETAILS { char c; clrscr(); char ch; gotoxy(30,1); cout<<" [ADDITION] "; cout<<"n ENTER HOUSE PHONE NUMBER (max 7 digits) :"; cin>>pn1; cout<<"n ENTER MOBILE PHONE NUMBER (max 10 digits) :"; cin>>pn2; cin.get(ch); cout<<" n ENTER NAME : ";
  • 15. cin.getline(name,20,'n'); cout<<" n ENTER HOUSE ADDRESS : "; cin.getline(address1,50,'n'); cout<<"n ENTER EMAIL ADDRESS : "; cin.getline(emailadd,40,'n'); cout<<"nnnnn Want to exit(Y/N) :"; cin>>c; if (c=='Y'||c=='y') exit(0); } void directory::view1() //TO DISPLAY ALL THE RECORDS { cout<<"n"; cout<<" PHONE NUMBER1 :"<<obj.pn1<<"n"; cout<<" PHONE NUMBER2 :"<<obj.pn2<<"n"; cout<<" NAME : "<<obj.name<<"n"; cout<<" HOUSE ADDRESS : "<<obj.address1<<"n"; cout<<" EMAIL ADDRESS : "<<obj.emailadd<<"n"; getch(); }
  • 16. void directory::modification() //TO MODIFY ANY DATA IN THE RECORD IF NECESSARY { clrscr(); gotoxy(30,1); cout<<" [MODIFICATION] "; long pn; int n,i; ifstream fin; ofstream fout; fin.open("telephone.dat"); if (fin.fail()) { cout<<"n FILE NOT FOUND ! "; fout.close(); exit(0); } fout.open("new"); n=test(); if (n==0) { cout<<"n FILE IS EMPTY ! "; getch(); return;
  • 17. } while(fin.good()) { fin.read((char*)&obj,sizeof(obj)); fout.write((char*)&obj,sizeof(obj)); } fin.close(); fout.close(); fout.open("telephone.dat",ios::trunc); fin.open("new"); if (fin.fail()) { cout<<"n FILE NOT FOUND ! "; exit(0); } char ch; cout<<"n ENTER PHONE NUMBER : "; cin>>pn; ch=cin.get(); for(i=0;i<n;i++) { fin.read((char*)&obj,sizeof(obj)); char d; if (pn==pn1)
  • 18. { view1(); d=check("MOBILE PHONE NUMBER"); if((d=='y')||(d=='Y')) {cout<<"n ENTER NEW PHONE NUMBER:"; cin>>pn1; ch=cin.get(); } if(check("MOBILE PHONE NUMBER")=='Y') {cout<<"n ENTER NEW PHONE NUMBER:"; cin>>pn2; ch=cin.get(); cin.get(ch); } if(check("NAME")=='y') { cout<<"n ENTER NEW NAME :"; cin.getline(name,20,'n'); } if(check("HOME ADDRESS")=='y') { cout<<"n ENTER NEW ADDRESS :"; cin.getline(address1,50,'n'); }
  • 19. if(check("EMAIL ADDRESS")=='y') {cout<<"n ENTER NEW EMAIL ADDRESS :"; cin.getline(emailadd,25,'n'); } } fout.write((char*)&obj,sizeof(obj)); } } char directory::check(char *s) { cout<<"n MODIFY t"<<s<<"t"<<"Y/N"; char ch; ch=getch(); if((ch=='y')||(ch=='Y')) return 'y'; else return 'n'; } void directory::deleate() { clrscr(); window(1,1,80,25);
  • 20. gotoxy(30,1); cout<<" [DELETION] "; long pn; int n,i; ifstream fin; ofstream fout; fin.open("telephone.dat",ios::in); if (fin.fail()) { cout<<"n FILE NOT FOUND ! "; getch(); return; } fout.open("new"); n=test(); if (n==0) { cout<<"n FILE IS EMPTY "; getch(); return; } for(i=0;i<n;i++) { fin.read((char*)&obj,sizeof(obj));
  • 21. fout.write((char*)&obj,sizeof(obj)); } fin.close(); fout.close(); fout.open("telephone1.dat",ios::trunc); fin.open("new"); if(fin.fail()) { cout<<"n FILE NOT FOUND !"; getch(); return; } cout<<"n ENTER PHONE NUMBER :"; cin>>pn; for(i=0;i<n;i++) { fin.read((char*)&obj,sizeof(obj)); if(pn!=pn1) { fout.write((char*)&obj,sizeof(obj)); } } fout.close(); fin.close();
  • 22. } void directory::view() { ifstream fin; int n,j; fin.open("telephone.dat",ios::in); if(fin.fail()||fin.bad()) { cout<<"n FILE NOT FOUND !"; getch(); return; } clrscr(); int i=0; n=test(); for(j=0;j<n;j++) { cout<<"n RECORD"<<(i+1)<<"n"; fin.read((char*)&obj,sizeof(obj)); cout<<"n PHONE NUMBER1 :"<<obj.pn1<<"n"; cout<<"n PHONE NUMBER2 :"<<obj.pn2<<"n"; cout<<"n NAME :"<<obj.name<<"n"; cout<<"n HOUSE ADDRESS :"<<obj.address1<<"n";
  • 23. // cout<<"n OCCUPATION ADDRESS :"<<obj.occupation<<"n"; // cout<<"n OFFICE ADDRESS : "<<obj.address2<<"n"; // cout<<"n INTERNET ADDRESS : "<<obj.internetadd<<"n"; cout<<"n EMAIL ADDRESS :"<<obj.emailadd<<"n"; i+=1; } fin.close(); getch(); } void directory::menu() { char ch; clrscr(); gotoxy(20,3); cout<<"TELEPHONE DIRECTORY: What You Want to do?"; //textcolor(RED); gotoxy(30,8); cout<<" A: ADDITION";
  • 24. gotoxy(30,11); cout<<" D: DELETION nr"; gotoxy(30,14); cout<<" M: MODIFICATION nr"; gotoxy(30,17); cout<<" V: VIEW nr"; gotoxy(30,20); cout<<" S: SEARCH nr"; gotoxy(30,23); cout<<" E: EXIT nr"; ch=getch(); switch(ch) { case'a': case'A': addition(); break; case'd': case'D': deleate(); break; case'm': case'M': modification(); break;
  • 25. case'v': case'V': view(); break; case's': case'S': search(); break; case'e': case'E': clrscr(); exit(0); } } int main() { welcome_screen(); for(;;) obj.menu(); return 0; } output screen 1 welcome screen
  • 26. 2. operational screen 3. addition screen
  • 27. 4. screen after adding one record 5. view operation screen
  • 28. 6 search operation screen 7 screen after search operation
  • 29. 8 modification operation screen 9 screen after input in modification operation
  • 30. 10 screen after modification in modification operation 11. input in delete operation screen
  • 31. 12. view operation screen after deletion