Question: C++ written program please Problem 2: (Phone Number Lookup) Write a program that initializes two arrays: one is a string array that contains names and
C++ written program please

Problem 2: (Phone Number Lookup) Write a program that initializes two arrays: one is a string array that contains names and the other is an array of long integers containing phone numbers (as long integers without spaces or hyphens). Each array should have length at least 5. Prompt the user to input a name. Then, search the first array for that name using a loop. If the name exists, then print out the phone number from the other array (at the same subscript where you found the name) in the form xxx-xxx-xxxx. If the name does not exist in the first array, then print out an error message. For example, suppose the first array is: {"Mike", "Sue", "Joe", '"Mary", "Bob" and the second is: 1234567890, 9876543210, 5463728109, 3456789012, 7531086420; [notice no hyphens] If the user enters "Sue", then your program should print out 987-654-3210 (with the hyphens) If the user enters "Jen", then the program should print out an error message. Please use made-up names and phone numbers as I don't need any personal information about anybody
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
