Class 12 Computer Science Project On Telephone Directory For C++
Class 12 Computer Science Project On Telephone Directory For C++
PROJECT FILE
TELEPHONE
DIRECTORY
NAME -
CLASS - 12 ROLL No- SESSION- 2019-2020
SCHOOL - ARMY PUBLIC SCHOOL BARRACKPORE
TABLE OF CONTENTS
Acknowledgement
Coding
Motive
Requirements
Bibliography
Limitations
Certificate
ACKNOWLEDGEMENT
#include <iomanip.h>
#include <conio.h>
#include<string.h>
#include<stdio.h>
class phoneBook{
char name[20],phno[15];
public:
void getdata();
void showdata();
strcpy(name,nm);
strcpy(phno,telno);
};
gets(name);
cout<<"\n\n -----------------------------------------------\n\n";
cout<<"\n\n -----------------------------------------------\n\n";
cout<<"\n\n";
cout<<setw(20)<<name;
cout<<setw(15)<<phno;
phoneBook ac;
ifstream inFile;
ofstream outFile;
inFile.open("phone.dat",ios::binary);
if(!inFile)
return;
outFile.open("Tempo.dat",ios::binary);
inFile.seekg(0,ios::beg);
if(strcmp(ac.getphno(),n)!=0)
}
inFile.close();
outFile.close();
remove("phone.dat");
rename("Tempo.dat","phone.dat");
void main(){
phoneBook rec;
fstream file;
char ch,nm[20],tel[15],telno[15];
int choice,found=0;
do {
clrscr();
cout<<"\n\n-------------------Phone Book---------------------\n\n";
cout<<"6) Exit\n";
cin>>choice;
switch(choice){
case 1 :
rec.getdata();
cin.get(ch);
break;
file.seekg(0,ios::beg);
while(file){
if(!file.eof())
rec.showdata();
file.clear();
getch();
break;
gets(nm);
file.seekg(0,ios::beg);
found=0;
if(strcmp(nm,rec.getname())==0)
found=1;
rec.showdata();
file.clear();
if(found==0)
getch();
break;
cin>>telno;
file.seekg(0,ios::beg);
found=0;
while(file.read((char *) &rec, sizeof(rec)))
if(strcmp(telno,rec.getphno())==0)
found=1;
rec.showdata();
file.clear();
if(found==0)
getch();
break;
gets(nm);
file.seekg(0,ios::beg);
found=0;
int cnt=0;
cnt++;
if(strcmp(nm,rec.getname())==0)
found=1;
break;
file.clear();
if(found==0)
cin.get(ch);
if(file.eof())
file.clear();
cin>>telno;
file.seekp(location);
rec.update(nm,telno);
file.flush();
getch();
break;
}} while(choice<=5);
out:
file.close();
}
MOTIVE
GLOBALIZED USAGE.
REQUIREMENTS
HARDWARE REQUIRED
SOFTWARE REQUIRED
www.cbseportal.com
SCREEN SHOTS OF
EXECUTION
MAIN MENU
Roll No :
__________________ __________________