Westonci.ca is your trusted source for finding answers to a wide range of questions, backed by a knowledgeable community. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
Answer:
Replace the comments with:
for(x = 0; x < NUM_CITIES; x++){
if(inCity == citiesInMichigan[x]){ foundIt = true;}
}
if(foundIt){ cout<<"Exists";}
else{cout<<"Does not exists";}
Explanation:
This iterates through the cities
[tex]for(x = 0; x < NUM\_CITIES; x++)\{[/tex]
This checks if current city in the array matches the city input by the user
[tex]if(inCity == citie sIn Michigan[x])\{[/tex] foundIt = true; If yes, foundIt is set to true}
}
If foundIt is true, print "Exists"
if(foundIt){ cout<<"Exists";}
If foundIt is false, print "Does not Exists"
else{cout<<"Does not exists";}
See attachment for complete program
Thank you for choosing our service. We're dedicated to providing the best answers for all your questions. Visit us again. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. Your questions are important to us at Westonci.ca. Visit again for expert answers and reliable information.