Join the IDNLearn.com community and start getting the answers you need today. Ask your questions and receive reliable, detailed answers from our dedicated community of experts.
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
We greatly appreciate every question and answer you provide. Keep engaging and finding the best solutions. This community is the perfect place to learn and grow together. Your search for solutions ends here at IDNLearn.com. Thank you for visiting, and come back soon for more helpful information.