Menu

[solved]-Using Visual Basic Modify Existing Program Order Search Array Find Exact Match Another Obj Q39019896

Using Visual Basic modify an existing program in order to searchan array to find an exact match. Another objective is to workthrough any syntax errors encountered (debugging) to develop acorrect solution that is free of errors.

Output how many cities were searched. Remember don’t hard-codethis to 10 in your program. Use the Length property of thearray.

Display the city name in the output such as City Detroit foundand Canton is not a city in Michigan.

Display a message if the city is found as well as if the city isnot found. Make sure you use a For loop

code as follows….

‘ MichiganCities.vb – This program prints a message for invalidcities in Michigan. ‘ Input: Interactive ‘ Output: Error message ornothing Option Explicit On Option Strict On Module Module1 SubMain() ‘ Declare variables. Dim City As String ‘ city to look up inarray ‘ Initialized array of Michigan cities Dim CityNames() AsString = {“Acme”, “Albion”, “Detroit”, “Watervliet”, “Coloma”,”Saginaw”, “Richland”, “Glenn”, “Midland”, “Brooklyn”} Dim FoundItAs Boolean = False ‘ Flag variable Dim X As Integer ‘ Loop controlvariable ‘ Get user input City = InputBox$(“Enter city name: “) ‘Write your loop here ‘ Write your test statement here to see ifthere is ‘ a match. Set the flag to true if city is found.

Expert Answer


Answer to Using Visual Basic modify an existing program in order to search an array to find an exact match. Another objective is t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *