Question: Searching an Array fo an atch cities in Michigan 2// Input: Interactte Summary 3 // Output: Error nessage or nothtng In this lab, you use

 Searching an Array fo an atch cities in Michigan 2// Input:
Interactte Summary 3 // Output: Error nessage or nothtng In this lab,
you use what you have learned about searching an array to find

Searching an Array fo an atch cities in Michigan 2// Input: Interactte Summary 3 // Output: Error nessage or nothtng In this lab, you use what you have learned about searching an array to find an exact match to complete a partially prewritten C++ program. The program uses an array that contains valid names for 10 cities in Michigan. You ask the user to enter a city name; your program then searches the array for that city name. If it is not found, the program should print a message that informs the user the city name is not found in the list of valid cities in Michigan. 5#include usipg nanespace std int nain ing tncity.2 hae of ctty to ook to t tnt NUM CITIES 1% string cittesInMichigan) ( Watervliee. Colona "Sagtnan file provided for this lab includes the input statements and the necessary variable declarations. You need to usea loop to examine all the items in the array and test for a match. You also bool foundIt - f int x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!