Which of the following code segments is the correct solution for the following problem?
Find the first occurrence of the value “Joe” in the array strNames. Save the index of the element containing "Joe" in a variable named intPosition. Discontinue searching the array once the first occurrence of the element “Joe” has been located. Assume any variables you need are already defined.
a. ```For intCount = 0 To strNames.length-1
If strNames(intCount) = "Joe" Then
intPosition = intCount
End If
Next
```
b. ```blnFound = True
intCount = 0
Do While (Not blnFound) And (intCount <= strNames.Length – 1)
If strNames(intCount) = "Joe" Then
blnFound = False
positon = intCount
End If
intCount += 1
Loop
```
c. ```blnFound = False
intCount = 0
Do While (Not blnFound) And (intCount < strNames.Length)
If strNames(intCount) = "Joe" Then
blnFound = True
intPosition = intCount
End If
intCount += 1
Loop
```
d. ```blnFound = False
For intCount = 0 to strNames.Length -1 and Not blnFound
If strNames(intCount) = "Joe" Then
blnFound = True
intPosition = intCount
End If
Next
```
c. ```blnFound = False
intCount = 0
Do While (Not blnFound) And (intCount < strNames.Length)
If strNames(intCount) = "Joe" Then
blnFound = True
intPosition = intCount
End If
intCount += 1
Loop
```
You might also like to view...
What are the drawbacks of using a symbolic link?
What will be an ideal response?
Social engineering impersonation means to masquerade as a real or fictitious character and then play out the role of that person on a victim.
Answer the following statement true (T) or false (F)
Once a Flash movie has been added to a page, a(n) ____ rectangle appears in the page.
A. orange B. black C. yellow D. gray
Look up Sierpinski’s triangle. Write a recursive function with turtles to create Sierpinski’s triangle.
Note: Sierpinski’s triangle is very similar to the result of nestedTri. Additionally, trying to turn the turtle to begin with to set the triangle up “correctly” will lead the turtle getting slightly off.