Sei sulla pagina 1di 20

Maharashtra State Board Of Technical Education

Shivajirao .S. Jondhale Polytechnic, Ambernath(E)

Micro Project
Topic
TELEPHONE DIRECTORY

Program name: Object Oriented Program using C++


Program code: 22316
Course name:Information Technology
Course Code: IF3I
Guide:Mamta Khatri
INDEX
SR NO. CONTENTS PAGE NO.
Group Details

Roll No Name Enrollment Number Seat Number

1007 Sweta Deshmukh


1008 Suyesh Jagdale
1009 Rohit Nandurkar
1010 Vaibhav Meshram
1011 Pranav Kambali 1701470037
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

CERTIFICATE

This to certify that Ms. Sweta Deshmukh Roll No. 1007,


of Third Semester of diploma in Information technology
of institute Shivajirao.S. Jondhale polytechnic,
Ambernath (E) (Code 0147) has completed the term work
satisfactorily in subject Object Oriented Programming
C++ (22316) for academic year 2019 to 2020 as prescribed
in the curriculum.

Place: Ambernath Enrollment No:


Date: Exam. Seat No:

Subject Teacher Head of Department Principal


MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

CERTIFICATE

This to certify that Mr.Suyesh Jagdale Roll No. 1008, of


Third Semester of diploma in Information technology of
institute Shivajirao.S. Jondhale polytechnic, Ambernath
(E) (Code 0147) has completed the term work satisfactorily
in subject Object Oriented Programming C++ (22103) for
academic year 2019 to 2020 as prescribed in the
curriculum.

Place: Ambernath Enrollment No:


Date: Exam. Seat No:

Subject Teacher Head of Department Principal


MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

CERTIFICATE

This to certify that Mr. Rohit Nandurkar Roll No. 1009, of


Third Semester of diploma in Information technology of
institute Shivajirao.S. Jondhale polytechnic, Ambernath
(E) (Code 0147) has completed the term work satisfactorily
in subject Object Oriented Programming C++ (22316) for
academic year 2019 to 2020 as prescribed in the
curriculum.

Place: Ambernath Enrollment No:


Date: Exam. Seat No:

Subject Teacher Head of Department Principal


MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

CERTIFICATE

This to certify that Mr. Vaibhav Meshram Roll No. 1010,


of Third Semester of diploma in Information technology
of institute Shivajirao.S. Jondhale polytechnic,
Ambernath (E) (Code 0147) has completed the term work
satisfactorily in subject Object Oriented Programming
C++ (22316) for academic year 2019 to 2020 as prescribed
in the curriculum.

Place: Ambernath Enrollment No:


Date: Exam. Seat No:

Subject Teacher Head of Department Principal


MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

CERTIFICATE

This to certify that Mr.Pranav Kambali Roll No. 1011, of


Third Semester of diploma in Information technology of
institute Shivajirao.S. Jondhale polytechnic, Ambernath
(E) (Code 0147) has completed the term work satisfactorily
in subject Object Oriented Programming C++ (22316) for
academic year 2019 to 2020 as prescribed in the
curriculum.

Place: Ambernath Enrollment No: 1701470037


Date: Exam. Seat No:

Subject Teacher Head of Department Principal


//Telephone Directory

#include<iostream.h>

#include<fstream.h>

#include<string.h>

#include<iomanip.h>

#include<conio.h>

class phonebook

char name[20],phno[15];

public:

void getdata ();

void showdata();

char *getname() { return name;}

char *getphno() { return phno;}

void update(char *nm,char *telno)

strcpy(name,nm);

strcpy(phno,telno);

};

void phonebook::getdata()

cout<<"\Enter Name:";

cin>>name;

cout<<"Enter phone no:";

cin>>phno;

void phonebook::showdata()
{

cout<<"\n";

cout<<setw(20)<<name;

cout<<setw(15)<<phno;

void main()

phonebook rec;

fstream file;

file.open("d:\\phone.dat",ios::ate | ios::in |ios::out);

char ch,nm[20],telno[6];

int choice,found=0;

while(1)

clrscr();

cout<<"\n*****phone Book*****\n";

cout<<"1) Add new record\n";

cout<<"2) Display all records\n";

cout<<"3) Search person name.\n";

cout<<"4) Search telephone no\n";

cout<<"5) Update telephone no.\n";

cout<<"6) Exit\n";

cout<<"choose your choice:";

cin>>choice;

switch(choice)

case 1://New record

rec.getdata();

cin.get(ch);
file.write((char*) &rec,sizeof(rec));

break;

case 2://Display all records

file.seekg(0,ios::beg);

cout<<"\n\nRecords in phonebook\n";

while(file)

file.read((char *) &rec,sizeof(rec));

if(!file.eof())

rec.showdata();

file.clear();

getch();

break;

case 3://Search tel no.when person name is known.

cout<<"\n\nEnter name:";

cin>>nm;

file.seekg(0,ios::beg);

found=0;

while(file.read((char *) &rec,sizeof(rec)))

if(strcmp(nm,rec.getname())==0)

found=1;

rec.showdata();

}
file.clear();

if(found==0)

cout<<"\n\n---Record not found---\n";

getch();

break;

case 4://Search name on basis of tel.no

cout<<"\n\nEnter telephone no:";

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)

cout<<"\n\n---Record not found---\n";

break;

case 5: //Update Telephone No.

cout<<"\n\nEnter Name :";

cin>>nm;

file.seekg(0,ios::beg);

found=0;

int cnt=0;
while(file.read((char*) &rec, sizeof(rec)))

cnt++;

if(strcmp(nm,rec.getname())==0)

found=1;

break;

file.clear();

if(found==0)

cout<<"\n\n---Record Not found---\n";

else

int location=(cnt-1)*sizeof(rec);

cin.get(ch);

if(file.eof())

file.clear();

cout<<"Enter New Telephone No:";

cin>>telno;

file.seekp(location);

rec.update(nm,telno);

file.write((char*) &rec,sizeof(rec));

file.flush();

break;

}
out:

file.close();

Potrebbero piacerti anche