Searching an Array for an Exact Match (C++ and Java)
Summary
In this lab, you use what you ha...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 28.05.2021 18:30 bbyrose29
Searching an Array for an Exact Match (C++ and Java)
Summary
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.
The file provided for this lab includes the input statements and the necessary variable declarations. You need to use a loop to examine all the items in the array and test for a match. You also need to set a flag if there is a match and then test the flag variable to determine if you should print the the Not a city in Michigan. message. Comments in the code tell you where to write your statements. You can use the previous Mail Order program as a guide.
Instructions
Ensure the provided code file named MichiganCities. cpp is open.
Study the prewritten code to make sure you understand it.
Write a loop statement that examines the names of cities stored in the array.
Write code that tests for a match.
Write code that, when appropriate, prints the message Not a city in Michigan..
Execte the program by clicking the "Run Code" button at the bottom of the screen. Use the following as input:
Chicago
Brooklyn
Watervliet
Acme
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 18:30
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 01:00
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
You know the right answer?
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 09.11.2020 20:20
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
English, 09.11.2020 20:20
![question](/tpl/images/cats/health.png)
Health, 09.11.2020 20:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 09.11.2020 20:20
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 09.11.2020 20:20
![question](/tpl/images/cats/en.png)
English, 09.11.2020 20:20
![question](/tpl/images/cats/mat.png)
Mathematics, 09.11.2020 20:20
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 09.11.2020 20:20
![question](/tpl/images/cats/mat.png)
Mathematics, 09.11.2020 20:20
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
History, 09.11.2020 20:20