c++ A contact list is a place where you can store a specific contact with other
ID: 3847385 • Letter: C
Question
c++
A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input a list of N word pairs representing a name and a phone number (both strings). That list is followed by a name, and your program should output that name's phone number. If the input is: the output is: 867-5309 For full credit, define and use a function: string Get Phone Number (vector name Vec, vector phone Number Vec, string Contact Name). The return value of Get Phone Number is the phone number associated with the specific contact name.Explanation / Answer
#include #include #include #include #include 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(){ coutname; coutphno; } void phoneBook :: showdata(){ 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.