create vba procedure called create object 3 CREATE AND SEARCH AN ARRAY (LISTINGS
ID: 3589391 • Letter: C
Question
create vba procedure called create object 3 CREATE AND SEARCH AN ARRAY (LISTINGS 7.1 AND 7.2 wILL BE HELPFUL) Using the Visual Basic Editor, create a VBA procedure named array_search that does the following: 3. a. Creates an array called animals. b. Adds 10 members to the array each containing a type of animal (such as dog, cow, etc.) c. Prompts the user for a type of animal. d. Searches the array for that animal. e. Displays a message indicating whether the animal was found in the array. 4 USING AN OBJECT VARIABLE 4. Using the Visual Basic Editor, create a VBA procedure named create_object that does the following Creates a variable of the Object type. Using the Set command, assign the third word of the first paragraph of the active document to the variable. Using appropriate methods, make the object bold. When you test the procedure, the third word of your document (test) should be bold. a. b. c. d.Explanation / Answer
3)
Public Class AnimalSearch
Public Shared Sub Main()
Dim animal_Array As [String]() = New [String](10) {"pig", "Donkey", "Elephant", "kangaroo", "rabbit", "leopard", "Fox", "tiger", "Lion,monkey"}
Dim animal As String
Console.Write("Enter Animal Name: ")
animal= Console.ReadLine()
Dim myIndex As Int32
myIndex = Array.IndexOf(animal_Array, animal, 0, 10)
Console.WriteLine("The first occurrence of ""{0}"" between index 0 and index 10 is at index {1}.", animal, myIndex)
Console.ReadLine()
End Sub
End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.