Write a simple telephone directory program in C++ that looks up phone numbers in
ID: 3645196 • Letter: W
Question
Write a simple telephone directory program in C++ that looks up phone numbers in a file containing a list of names and phone numbers. The user should be prompted to enter a first name and last name, and the program then outputs the corresponding number, or indicates that the name isn't in the directory. After each lookup, the program should ask the user whether they want to look up another number, and then either repeat the process or exit the program. The data on the file should be organized so that each line contains a first name, a last name, and a phone number, separated by blanks. You can return to the beginning of the file by closing it an opening it again.Use functional decomposition to solve the problem and code the solution using functions as appropriate. Be sure to use proper formatting and appropriate comments in your code. The output should be clearly labeled and neatly formatted, and the error messages should be informative.
Explanation / Answer
#include 002 #include 003 #include 004 #include 005 006 class account 007 { char id[8]; 008 char name[25]; 009 char address[45]; 010 char place[25]; 011 char phone_no[10]; 012 013 public: 014 void getdata() 015 016 { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.