Get the answers you need at Westonci.ca, where our expert community is always ready to help with accurate information. Our platform offers a seamless experience for finding reliable answers from a network of experienced professionals. Experience the ease of finding precise answers to your questions from a knowledgeable 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
Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Westonci.ca is committed to providing accurate answers. Come back soon for more trustworthy information.