SlideShare a Scribd company logo
SANT NIRANKARI PUBLIC SCHOOL
(2018-19)
COMPUTER
SCIENCE
PROJECT
CLASS – XII-A
Submitted to:-
Mrs.Gurjeet
TOPIC:
TELEPHONE
DIARY
SUBMITTED BY:-
 Nitesh
CONTENT
1. Certificate
2. Acknowledgement
3. Introduction To C++
4. Introduction To Project
5. Header Files
6. Program Codes
7. Output
8. Bibliography
CERTIFICATE
This is to certify that Nitesh of class
XII-A has successfully completed this
project under my supervision and
guidance. he has kept all necessary
details in his mind while making this
project. he has compiled the whole
project as desired.
_____________ _____
Teacher’s signature
ACKNOWLEDGEMENT
I wish to express my sincere thanks to Mrs.Ranjana
Grover, Principal of Sant Nirankari Public School for
guiding me to cause the successful outcome of this
project work.
I wish to express my deep & profound sense of
gratitude to my guide/teacher Mrs.Gurjeet, for her
expert help &valuable guidance, comments and
suggestions.
I also place on record, my sincere Gratitude to one and
all who, Directly or Indirectly, Have Lent their helping
hand in this venture.
INTRODUCTION TO C++
C++ is a programming Language Developed by Bjarne
Stroustrup. It was originally named as C with classes, was
renamed as C++ in 1983.It is regarded as an intermediate-level
language, as it comprises both high level and low-level language
features. Its application domains include system software,
application software, device drivers, embedded software, high-
performance server and client applications, and entertainment
software such as video games. C++ continues to be used and is
one of the preferred programming languages to develop
professional applications .C++ includes several operators such
as comparison, arithmetic, bit manipulation, logical operators
etc. One of the most attractive features of C++ is that it enables
the overloading of certain operators such as addition.
A few of the essential concepts within C++ programming
language include polymorphism, virtual and friend functions,
templates, name spaces and pointers.
For a time, C++ had no official standard and was maintained by
a de- facto standard, however since 1993, C++ is standardized
by a committee of the ISO.
C++ compiles directly to a machine's native code, allowing it to
be one of the fastest languages in the world, if optimized. C++
also supports both static and dynamic type checking.
C++ allows type conversions to be checked either at compile-
time or at run-time, again offering another degree of flexibility.
Most C++ type checking is, however, static.
INTRODUCTION TO
PROJECT
The telephone management system is database system. In
the system, we will try to give full information of the
telephone’s administration to the users. The users are very
familiar to the system. This system will be making more
easily to telephone work comparison to manual system.
The telephone directory system is a live project and it
provides a good flexibility and quick service.
In this system, we briefly describe the two main modules
that are generally used in telephone exchange i.e.
Registration and Evaluation. These two parts are
generally used in any telephone exchange and that is very
common or important.
Administration is the first module of the telephone
directory. This module contains the full information
about telephone exchange like customer’s details,
telephone number, std codes, etc. user can easily enter the
data in fields of the form like name, address, city, phone
number. This is the last and final module of the project.
Every telephone directory has needs to done this process.
Manually this very tedious, tough and time consuming
work but we want to make it easier to do this. In the
evaluation we find out the details customers.
Header Files
IOSTREAM.H - for basic I/O operations
CONIO.H - for clrscr()and getch() function
STDIO.H - for standard I/O operations
FSTREAM.H - for file handling
STRING.H – for string handling
PROCESS.H –for exit() function
DOS.H – for delay function
PROGRAM CODING
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
#include<dos.h>
class tel_bil
{
private:
int calls;
char name[100],adrs[100],city[30];
public:
char tel_no[15];
long unsigned int cons_no;
void show_data();
void get_data();
};
fstream file;
void tel_bil::get_data()
{
char ch;
cin.get(ch);
cout<<"ntENTER NAME: ";
cin.getline(name,30);
cout<<"ntENTER ADDRESS: ";
cin.getline(adrs,100);
cout<<"ntENTER CITY: ";
cin.getline(city,40);
cout<<"ntENTER TOTAL NO. OF CALLS: ";
cin>>calls;
}
void tel_bil::show_data()
{
float tax=0.02;
float charge;
int n;
char ch;
if(calls>=50)
{
n=calls-50;
tax=tax*n;
charge=tax+(2*n)+60;
}
else
{
n=0;
tax=0;
charge=60;
}
cout<<"ntttBHARAT SANCHAR NIGAM LIMITED";
cout<<"ntttttPOSTPAID";
cout<<"nnttt_______________________________________
";
cout<<"ntTELEPHONE NO.: "<<tel_no;
cout<<"ntCONSUMER NO.: "<<cons_no;
cout<<"ntCONSUMER NAME: ";
cout<<name;
cout<<"ntADDRESS: ";
cout<<adrs;
cout<<"ntCITY: ";
cout<<city;
cout<<"ntTOTAL NO. OF CALLS: ";
cout<<calls;
cout<<"ntFREE CALLS :"<<"50";
cout<<"ntCHARGEABLE CALLS: "<<n;
cout<<"ntTAX (2%):"<<tax;
cout<<"ntCHARGE PER CALL: "<<"Rs.2";
cout<<"ntADDITIONAL CHARGES: Rs. 60";
cout<<"ntTOTAL CHARGES: "<<charge;
}
void main()
{
clrscr();
tel_bil a;
int choice;
char ch;
cout<<"nnntttWELCOME TO THE PROJECT";
cout<<"ntt______________________________________";
cout<<"nntttTELEPHONE BILLING SYSTEM";
cout<<"ntt______________________________________";
delay(2000);
while(1)
{
clrscr();
cout<<"nttttOPTIONS";
cout<<"nt1. TO ADD NEW RECORD"<<"nt2. TO SEE RECORD"<<"nt3.
FOR ENQUIRY" <<"nt4. TO MODIFY RECORD"<<"nt5. TO
DELETE"<<"nt6. QUIT"; cout<<"nntENTER YOUR CHOICE: ";
cin>>choice;
clrscr();
if(choice==1) //to add record
{
char no[15];
int flag;
long unsigned int p,q;
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);
cout<<"ntENTER TELEPHONE NO.: ";
cin.get(ch);
cin.getline(no,15);
file.seekg(0);
flag=0;
do
{
file.read((char*)&a,sizeof(a));
if(strcmp(a.tel_no,no)==0)
{
cout<<"nnttTHIS TELEPHONE NO. ALREADY EXIST.........";
flag=1;
getch();
break;
}
}
while(!file.eof());
file.close();
if(flag==0)
{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);
file.seekp(0,ios::end);
p=file.tellp();
q=(p/sizeof(a))+1;
strcpy(a.tel_no,no);
a.cons_no=q;
a.get_data();
file.write((char*)&a,sizeof(a));
cout<<"nnttRECORD ADDED...............";
file.close();
getch();
}
}
else
if(choice==2) //to see record
{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);
file.seekg(0);
int t=0;
while(file.read((char*)&a,sizeof(a)))
{
t=1 ;
cout<<"nn";
a.show_data();
getch();
}
if(t==0)
{
cout<<"nnttFILE DOES NOT EXIST.............";
getch();
}
file.close();
}
else
if(choice==3) //for enquiry
{
file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate);
char no1[15];
int i=0;
cout<<"nnttENTER THE TELEPHONE NO.: ";
cin.get(ch);
cin.getline(no1,15);
file.seekg(0);
do
{
file.read((char*)&a,sizeof(a));
if(strcmp(a.tel_no,no1)==0)
{
a.show_data();
i=1;
getch();
break;
}
}
while(!file.eof());
if(i==0)
{
cout<<"nnttTHIS TELEPHONE NO. DOES NOT EXIST.........";
getch();
}
file.close();
}
else
if(choice==4) // for modification
{
long unsigned int b;
int s=0;
file.open("tel.dat",ios::in|ios::binary|ios::out);
char no2[15],no3[15];
file.seekg(0);
cout<<"nnttENTER THE TELEPHONE NO. TO BE MODIFIED: ";
cin.get(ch);
cin.getline(no2,15);
while(file.read((char*)&a,sizeof(a)) && s==0)
{
if(strcmp(a.tel_no,no2)==0)
{
a.show_data();
getch();
clrscr();
cout<<"ntttENTER NEW RECORDS";
cout<<"nnttENTER TELEPHONE NO.: ";
cin.getline(no3,15);
strcpy(a.tel_no,no3);
a.get_data();
int pos=-1*sizeof(a);
file.seekp(pos,ios::cur);
file.write((char*)&a,sizeof(a));
cout<<"nntt RECORD UPDATED...........";
s=1;
delay(1000);
break;
}
}
if(s==0)
{
cout<<"nnttNO. NOT FOUND......." ;
getch();
}
file.close();
}
else
if(choice==5) //to delete
{
char no[15];
int k=0;
cout<<"nnttENTER THE TELEPHONE NO. YOU WANT TO DELETE: ";
cin.get(ch);
cin.getline(no,15);
file.open("tel.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
file.seekg(0,ios::beg);
fp2.seekg(0,ios::beg);
while(file.read((char*)&a,sizeof(a)))
{
if(strcmp(a.tel_no,no)==0)
{
a.show_data();
k=1;
cout<<"nnttRECORD DELETED ......";
}
else
fp2.write((char*)&a,sizeof(a));
}
fp2.close();
file.close();
if(k==0)
{
cout<<"nnttNO. NOT FOUND.......";
}
remove("tel.dat");
rename("Temp.dat","tel.dat");
getch();
clrscr();
}
else
if(choice==6) //exit
exit(0);
else
{
cout<<"nnttWRONG CHOICE....";
delay(1000);
}
}
}
OUTPUT
1.Welcome Screen.
2. Menu Screen.
3. To Add Records.
4. To See Records.
5. To do Enquiry.
When phone number does not exists.
6. To Modify Records.
7.Deletion of Record.
BIBLIOGRAPHY
HELP FROM INTERNET
INFORMATION FROM BOOKS
HELP FROM TEACHERS

More Related Content

PDF
Computer science project.pdf
PDF
Computer project final for class 12 Students
DOCX
class 12th computer science project Employee Management System In Python
DOCX
computer science project for class 12 on telephone billing
PDF
Library Management Python, MySQL
PDF
Computer science Project for class 11th and 12th(library management system)
PDF
Computer science class 12 project on Super Market Billing
DOCX
12th CBSE Computer Science Project
Computer science project.pdf
Computer project final for class 12 Students
class 12th computer science project Employee Management System In Python
computer science project for class 12 on telephone billing
Library Management Python, MySQL
Computer science Project for class 11th and 12th(library management system)
Computer science class 12 project on Super Market Billing
12th CBSE Computer Science Project

What's hot (20)

PDF
Computer Science Investigatory Project Class 12
DOCX
computer science with python project for class 12 cbse
DOCX
Report Card making BY Mitul Patel
PDF
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
ODT
Library Management Project (computer science) class 12
PDF
Computer Project for class 12 CBSE on school management
PDF
Python and MySQL Linking Class 12th Project File 23-24
PDF
Computer science project on Online Banking System class 12
DOCX
PHYSICS INVESTIGATORY PROJECT ON WATER LEVEL INDICATOR
PDF
IP Project for Class 12th CBSE
DOCX
Computer science project work
DOCX
Project front page, index, certificate, and acknowledgement
PPTX
Computer Science Investigatory Project
PDF
Informatics Practices/ Information Practices Project (IP Project Class 12)
DOCX
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
DOCX
CBSE Class 12 Computer practical Python Programs and MYSQL
DOCX
IP Final project 12th
DOCX
cbse 12 computer science IP
DOCX
Ip library management project
PDF
Python Project On Cosmetic Shop system
Computer Science Investigatory Project Class 12
computer science with python project for class 12 cbse
Report Card making BY Mitul Patel
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Library Management Project (computer science) class 12
Computer Project for class 12 CBSE on school management
Python and MySQL Linking Class 12th Project File 23-24
Computer science project on Online Banking System class 12
PHYSICS INVESTIGATORY PROJECT ON WATER LEVEL INDICATOR
IP Project for Class 12th CBSE
Computer science project work
Project front page, index, certificate, and acknowledgement
Computer Science Investigatory Project
Informatics Practices/ Information Practices Project (IP Project Class 12)
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
CBSE Class 12 Computer practical Python Programs and MYSQL
IP Final project 12th
cbse 12 computer science IP
Ip library management project
Python Project On Cosmetic Shop system
Ad

Similar to computer science project class 12th (20)

DOC
Telephone directory
DOC
Telephone directory in c
PDF
School Management (c++)
DOC
Tic tac toe
DOC
Tic tac toe game code
DOC
DOCX
Railway reservation(c++ project)
DOCX
Railway reservation(c++ project)
PDF
Presentation of Turbo C++ || Railway Reservation System project || B.Sc. student
PDF
Telephonedirectory (1)
DOC
Medical store management system
PDF
Telephone directory using c language
PPTX
Physics lab ppt for btech students in engineetin
DOC
Student record
DOC
DOCX
Project for Student Result System
PPT
Hotel Management Presentation by Aryan Singh Dhiman
PPTX
PRINCE PRESENTATION(1).pptx
DOCX
Online Job Portal
DOC
Ums in c
Telephone directory
Telephone directory in c
School Management (c++)
Tic tac toe
Tic tac toe game code
Railway reservation(c++ project)
Railway reservation(c++ project)
Presentation of Turbo C++ || Railway Reservation System project || B.Sc. student
Telephonedirectory (1)
Medical store management system
Telephone directory using c language
Physics lab ppt for btech students in engineetin
Student record
Project for Student Result System
Hotel Management Presentation by Aryan Singh Dhiman
PRINCE PRESENTATION(1).pptx
Online Job Portal
Ums in c
Ad

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Pre independence Education in Inndia.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Classroom Observation Tools for Teachers
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Structure & Organelles in detailed.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pre independence Education in Inndia.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Classroom Observation Tools for Teachers
FourierSeries-QuestionsWithAnswers(Part-A).pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Structure & Organelles in detailed.
O5-L3 Freight Transport Ops (International) V1.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Module 4: Burden of Disease Tutorial Slides S2 2025
VCE English Exam - Section C Student Revision Booklet
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial diseases, their pathogenesis and prophylaxis

computer science project class 12th

  • 1. SANT NIRANKARI PUBLIC SCHOOL (2018-19) COMPUTER SCIENCE PROJECT CLASS – XII-A Submitted to:- Mrs.Gurjeet
  • 3. CONTENT 1. Certificate 2. Acknowledgement 3. Introduction To C++ 4. Introduction To Project 5. Header Files 6. Program Codes 7. Output 8. Bibliography
  • 4. CERTIFICATE This is to certify that Nitesh of class XII-A has successfully completed this project under my supervision and guidance. he has kept all necessary details in his mind while making this project. he has compiled the whole project as desired. _____________ _____ Teacher’s signature
  • 5. ACKNOWLEDGEMENT I wish to express my sincere thanks to Mrs.Ranjana Grover, Principal of Sant Nirankari Public School for guiding me to cause the successful outcome of this project work. I wish to express my deep & profound sense of gratitude to my guide/teacher Mrs.Gurjeet, for her expert help &valuable guidance, comments and suggestions. I also place on record, my sincere Gratitude to one and all who, Directly or Indirectly, Have Lent their helping hand in this venture.
  • 6. INTRODUCTION TO C++ C++ is a programming Language Developed by Bjarne Stroustrup. It was originally named as C with classes, was renamed as C++ in 1983.It is regarded as an intermediate-level language, as it comprises both high level and low-level language features. Its application domains include system software, application software, device drivers, embedded software, high- performance server and client applications, and entertainment software such as video games. C++ continues to be used and is one of the preferred programming languages to develop professional applications .C++ includes several operators such as comparison, arithmetic, bit manipulation, logical operators etc. One of the most attractive features of C++ is that it enables the overloading of certain operators such as addition. A few of the essential concepts within C++ programming language include polymorphism, virtual and friend functions, templates, name spaces and pointers. For a time, C++ had no official standard and was maintained by a de- facto standard, however since 1993, C++ is standardized by a committee of the ISO. C++ compiles directly to a machine's native code, allowing it to be one of the fastest languages in the world, if optimized. C++ also supports both static and dynamic type checking. C++ allows type conversions to be checked either at compile- time or at run-time, again offering another degree of flexibility. Most C++ type checking is, however, static.
  • 7. INTRODUCTION TO PROJECT The telephone management system is database system. In the system, we will try to give full information of the telephone’s administration to the users. The users are very familiar to the system. This system will be making more easily to telephone work comparison to manual system. The telephone directory system is a live project and it provides a good flexibility and quick service. In this system, we briefly describe the two main modules that are generally used in telephone exchange i.e. Registration and Evaluation. These two parts are generally used in any telephone exchange and that is very common or important. Administration is the first module of the telephone directory. This module contains the full information about telephone exchange like customer’s details, telephone number, std codes, etc. user can easily enter the data in fields of the form like name, address, city, phone number. This is the last and final module of the project. Every telephone directory has needs to done this process. Manually this very tedious, tough and time consuming work but we want to make it easier to do this. In the evaluation we find out the details customers.
  • 8. Header Files IOSTREAM.H - for basic I/O operations CONIO.H - for clrscr()and getch() function STDIO.H - for standard I/O operations FSTREAM.H - for file handling STRING.H – for string handling PROCESS.H –for exit() function DOS.H – for delay function
  • 9. PROGRAM CODING #include<fstream.h> #include<conio.h> #include<stdio.h> #include<string.h> #include<process.h> #include<dos.h> class tel_bil { private: int calls; char name[100],adrs[100],city[30]; public: char tel_no[15]; long unsigned int cons_no; void show_data(); void get_data(); };
  • 10. fstream file; void tel_bil::get_data() { char ch; cin.get(ch); cout<<"ntENTER NAME: "; cin.getline(name,30); cout<<"ntENTER ADDRESS: "; cin.getline(adrs,100); cout<<"ntENTER CITY: "; cin.getline(city,40); cout<<"ntENTER TOTAL NO. OF CALLS: "; cin>>calls; } void tel_bil::show_data() { float tax=0.02; float charge; int n; char ch; if(calls>=50)
  • 11. { n=calls-50; tax=tax*n; charge=tax+(2*n)+60; } else { n=0; tax=0; charge=60; } cout<<"ntttBHARAT SANCHAR NIGAM LIMITED"; cout<<"ntttttPOSTPAID"; cout<<"nnttt_______________________________________ "; cout<<"ntTELEPHONE NO.: "<<tel_no; cout<<"ntCONSUMER NO.: "<<cons_no; cout<<"ntCONSUMER NAME: "; cout<<name; cout<<"ntADDRESS: "; cout<<adrs; cout<<"ntCITY: "; cout<<city; cout<<"ntTOTAL NO. OF CALLS: ";
  • 12. cout<<calls; cout<<"ntFREE CALLS :"<<"50"; cout<<"ntCHARGEABLE CALLS: "<<n; cout<<"ntTAX (2%):"<<tax; cout<<"ntCHARGE PER CALL: "<<"Rs.2"; cout<<"ntADDITIONAL CHARGES: Rs. 60"; cout<<"ntTOTAL CHARGES: "<<charge; } void main() { clrscr(); tel_bil a; int choice; char ch; cout<<"nnntttWELCOME TO THE PROJECT"; cout<<"ntt______________________________________"; cout<<"nntttTELEPHONE BILLING SYSTEM"; cout<<"ntt______________________________________"; delay(2000); while(1) { clrscr();
  • 13. cout<<"nttttOPTIONS"; cout<<"nt1. TO ADD NEW RECORD"<<"nt2. TO SEE RECORD"<<"nt3. FOR ENQUIRY" <<"nt4. TO MODIFY RECORD"<<"nt5. TO DELETE"<<"nt6. QUIT"; cout<<"nntENTER YOUR CHOICE: "; cin>>choice; clrscr(); if(choice==1) //to add record { char no[15]; int flag; long unsigned int p,q; file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate); cout<<"ntENTER TELEPHONE NO.: "; cin.get(ch); cin.getline(no,15); file.seekg(0); flag=0; do { file.read((char*)&a,sizeof(a)); if(strcmp(a.tel_no,no)==0) {
  • 14. cout<<"nnttTHIS TELEPHONE NO. ALREADY EXIST........."; flag=1; getch(); break; } } while(!file.eof()); file.close(); if(flag==0) { file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate); file.seekp(0,ios::end); p=file.tellp(); q=(p/sizeof(a))+1; strcpy(a.tel_no,no); a.cons_no=q; a.get_data(); file.write((char*)&a,sizeof(a)); cout<<"nnttRECORD ADDED..............."; file.close(); getch(); } }
  • 15. else if(choice==2) //to see record { file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate); file.seekg(0); int t=0; while(file.read((char*)&a,sizeof(a))) { t=1 ; cout<<"nn"; a.show_data(); getch(); } if(t==0) { cout<<"nnttFILE DOES NOT EXIST............."; getch(); } file.close(); } else if(choice==3) //for enquiry
  • 16. { file.open("tel.dat",ios::in|ios::binary|ios::out|ios::app|ios::ate); char no1[15]; int i=0; cout<<"nnttENTER THE TELEPHONE NO.: "; cin.get(ch); cin.getline(no1,15); file.seekg(0); do { file.read((char*)&a,sizeof(a)); if(strcmp(a.tel_no,no1)==0) { a.show_data(); i=1; getch(); break; } } while(!file.eof()); if(i==0) { cout<<"nnttTHIS TELEPHONE NO. DOES NOT EXIST.........";
  • 17. getch(); } file.close(); } else if(choice==4) // for modification { long unsigned int b; int s=0; file.open("tel.dat",ios::in|ios::binary|ios::out); char no2[15],no3[15]; file.seekg(0); cout<<"nnttENTER THE TELEPHONE NO. TO BE MODIFIED: "; cin.get(ch); cin.getline(no2,15); while(file.read((char*)&a,sizeof(a)) && s==0) { if(strcmp(a.tel_no,no2)==0) { a.show_data(); getch(); clrscr(); cout<<"ntttENTER NEW RECORDS";
  • 18. cout<<"nnttENTER TELEPHONE NO.: "; cin.getline(no3,15); strcpy(a.tel_no,no3); a.get_data(); int pos=-1*sizeof(a); file.seekp(pos,ios::cur); file.write((char*)&a,sizeof(a)); cout<<"nntt RECORD UPDATED..........."; s=1; delay(1000); break; } } if(s==0) { cout<<"nnttNO. NOT FOUND......." ; getch(); } file.close(); } else if(choice==5) //to delete { char no[15];
  • 19. int k=0; cout<<"nnttENTER THE TELEPHONE NO. YOU WANT TO DELETE: "; cin.get(ch); cin.getline(no,15); file.open("tel.dat",ios::in|ios::out); fstream fp2; fp2.open("Temp.dat",ios::out); file.seekg(0,ios::beg); fp2.seekg(0,ios::beg); while(file.read((char*)&a,sizeof(a))) { if(strcmp(a.tel_no,no)==0) { a.show_data(); k=1; cout<<"nnttRECORD DELETED ......"; } else fp2.write((char*)&a,sizeof(a)); } fp2.close(); file.close(); if(k==0)
  • 22. 3. To Add Records. 4. To See Records.
  • 23. 5. To do Enquiry. When phone number does not exists.
  • 24. 6. To Modify Records.
  • 26. BIBLIOGRAPHY HELP FROM INTERNET INFORMATION FROM BOOKS HELP FROM TEACHERS