Write a program that has an array of at least 10 string objects that hold people
ID: 3620701 • Letter: W
Question
Write a program that has an array of at least 10 string objects that hold people’s names and phone numbers. You may make up your own strings, or use the following:“Becky Warren, 678-1223”
“Joe Looney, 586-0097”
“Geri Palmer, 223-8787”
“Lynn Presnell, 887-1212”
“Holly Gaddis, 223-8878”
“Sam Wiggins, 486-0998”
“Bob Kain, 586-8712”
“Tim Haynes, 586-7676”
“Warren Gaddis, 223-9037”
“Jean James, 678-4939”
“Ron Palmer, 486-2783”
The program should ask the user to enter a name or partial name to search for in the array. Any entries in the array that match the string entered should be displayed. For example, if the user enters “Palmer” the program should display the following names from the list:
Geri Palmer, 223-8787
Ron Palmer, 486-2783
this should use C++ string and vector for design & implementation
Explanation / Answer
Dear, #include #include using namespace std; int main() { char prods[10][27] = {"Becky Warren, 678-1223", "Joe Looney, 586-0097", "Geri Palmer, 223-8787", "Lynn Presnell, 887-1212", "Holly Gaddis, 223-8878" "Sam Wiggins, 486-0998", "Bob Kain, 586-8712" "Tim Haynes, 586-7676" "Warren Gaddis, 223-9037" "Jean James, 678-4939" "Ron Palmer, 486-2783" }; char lookUp[27], *strPtr = NULL; int index; 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.