subject

The procedure below is intended to display the index in a list of unique names(nameList) where a particular name(targetName) is found. If targetName is not found in nameList, the code should display 0. PRoCEDURE FindName (nameList, targetName)
{
index<-- 0
for EACH name IN nameList
{
index <-- index + 1
IF (name = targetName)
{
foundIndex <--- Index
}
ELSE
{
foundIndex <-- Index
}
ELSE
foundIndex<-- 0
}
}
DISPLAY (foundIndex)
}
Which of the following procedure calls can be used to demonstrate that the procedure does NoT work as intended?

a. FindName(["Andrea", "Ben"], "Ben")
b. FindName(["Andrea", "Ben"], "Diane)
c. FindName(["Andrea", "Ben", "Chris"], "Ben")
d. FindName(["Andrea", "Chris", "Diane"], "Ben")

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:50, savagesquid4807
Before you enter an intersection on a green light make sure
Answers: 2
image
Computers and Technology, 22.06.2019 18:00, deathfire5866
Determine whether the following careers would require training or college.
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, caromaybelline71
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, reaganphelps3
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
You know the right answer?
The procedure below is intended to display the index in a list of unique names(nameList) where a par...

Questions in other subjects: