Computers and Technology

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")

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:50, IdkHowToDoMath
Given int variables k and total that have already been declared, use a while loop to compute the sum of the squares of the first 50 counting numbers, and store this value in total. thus your code should put 11 + 22 + 33 + + 4949 + 50*50 into total. use no variables other than k and total.
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, woodpeckerdeejpe8wvh
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
image
Computers and Technology, 24.06.2019 09:50, potatocow
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, Cobetate
Multiple choice project create a program with two multiple choice questions. 1. users have two attempts only, show attempt number each time. hint: while loop with break control. (20%) 2. only one correct answer for each question, use switch case for each question. (20%) 3. show total score after the two questions are answered. hint: . (20%) 4. user have options to answer the two questions again if first attempt score is not 100%. hint: if statment. (20%) 5. use string method .toupper() to allow users to enter with lowercase or uppercase letters. (20%) 1. where is the capital of the state of florida? a. orlando b. tallahassee c. miami d. tampa b 2. where is walt disney world park located in florida? a. orlando b. tallahassee c. miami d. tampa a
Answers: 1
Do you know the correct answer?
The procedure below is intended to display the index in a list of unique names (nameList) where a pa...

Questions in other subjects:

Konu
History, 22.07.2019 20:00
Konu
History, 22.07.2019 20:00