subject

The procedure below is intended to display the index in a list of unique names (nameList) where a particular name (targetName) is found. lf 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 ← 0
}
}
DISPLAY (foundIndex)
}
Which of the following procedure calls can be used to demonstrate that the procedure does NOT Work as intended?
Select one:

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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
Corey set up his presentation for delivery to his team.the information he had to convey was critical to their job performance.he knew he would need a lot of time to explain each point
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2Δƒβ€”, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5Δƒβ€” slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
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 pa...
Questions
question
Mathematics, 18.07.2019 04:00
question
History, 18.07.2019 04:00
Questions on the website: 13722363