Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to implement a telephone directory using formatted I/O file. You should write a class TeleDirectory for storing the name, number and address

image text in transcribedWrite a program to implement a telephone directory using formatted I/O file. You should write a class TeleDirectory for storing the name, number and address of telephone holder. Your program should be capable of writing name, telephone number and address into a data file teledir.txt. Then write class functions searchByName: which should read the file and must return the Phone number of searched person and searchByNumber : which should read the file and must return the name of person holding the searched phone number. Also write a class function printDirectory which must read the complete directory and print all the records of the directory.

File Edit View Project Debug Test Analyze Tools Extensions Window Help Search (Ctrl+O Solution Attach... - SE * Live Share TeleDirectory.h = x 1 #ifndef TELEDIRECTORY_H_ 2. #define TELEDIRECTORY_H_ 3 #include 4 #include 5 #include 6 7 class TeleDirectory { 8 std::string name; 9 std::string address; 10 std::string phone_number; 11 public: 12. TeleDirectory(); 13 TeleDirectory(std::string, std::string, std::string); 14 void writeDirectory(std::string, std::string, std::string); 15 std::string searchByName(std::string); 16 std::string searchByNumber(std::string); void printDirectory(); virtual ~TeleDirectory(); 19 }; 17 18 20 21 #endif /* TELEDIRECTORY_H_ */ 22 Activate Windows Go to Settings to activate Windows 135 % No issues found Ready Ln 1 Col 1 Ch 1 INS Type here to search 12:20 AM 12/30/2020

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

Identify the elements that make up the employee reward package.

Answered: 1 week ago

Question

Understand the purpose, value and drawbacks of the interview.

Answered: 1 week ago