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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Plz 40 points what are raster vectors? a bitmap image a vector file a type of printing press a small projector
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
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
question
Mathematics, 15.12.2020 03:00
question
History, 15.12.2020 03:00
question
Mathematics, 15.12.2020 03:00
Questions on the website: 13722363