Answered You can hire a professional tutor to get the answer.

QUESTION

' MichiganCities.vb-This program prints a massage for invalid cities in Michigan. ' Input:Interactive ' Output:

' MichiganCities.vb-This program prints a massage for invalid cities in Michigan.  

' Input:Interactive

' Output:Error massage or nothing

Option Explicit On

Option Strict On

Module Module1

 Sub Main()

   ' Declarevariables.

 Dim City As String         ' city to look up in array

    ' Initialized array of Michigan cities

Dim CityNames() As String = {"Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"}

Dim FoundIt As Boolean = False   ' Flag variable

    Dim X As Integer      ' Loop control variable

    ' Get user input

    City = InputBox$("Enter city name: ")

    ' Add your loop here

      ' Add your test statement here to see if there is 

      ' a match. Set the flag to true if city is found. 

    ' Test to see if city was not found to determine if 

    ' "Not a city in Michigan" message should be printed

  End Sub ' End of Main() procedure

End Module ' End of MichiganCities module

1)For loop statement examining city 2)code test for match 3)code prints message "Not a city in Michigan" 4)Execute program using Chicago; Brooklyn; Watervliet; Acme 5)Output how many cities search.Dont hard-code to 10.Use Length property of array 6)Display city in output like City Detroit found & Canton is not a city in Michigan 7)Display message if city found/not found

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question