3. What is the error in the following pseudocode? // The searchName function accepts a string containing the name // to search for, an array of strings containing the names, and // string containing...


3. What is the error in the following pseudocode?<br>// The searchName function accepts a string containing the name<br>// to search for, an array of strings containing the names, and<br>// string containing the name is returned; otherwise a message<br>|/ an integer specifying the size of the array. The function<br>Programming Exercises<br>41<br>searches for the name in the array. If the name is found the<br>U indicating that the name was not found in the array is<br>// returned.<br>Function String searchName(String name, String names[],<br>Integer size)<br>Declare Boolean found<br>Declare Integer index<br>Declare String result<br>|/ Step through the array searching for the<br>// specified name.<br>While found == False AND index <= size - 1<br>If contains(names [index], name) Then<br>Set found<br>True<br>Else<br>Set index = index + 1<br>End If<br>End While<br>// Determine the result.<br>If found == True Then<br>Set result = names[index]<br>Else<br>Set result =

Extracted text: 3. What is the error in the following pseudocode? // The searchName function accepts a string containing the name // to search for, an array of strings containing the names, and // string containing the name is returned; otherwise a message |/ an integer specifying the size of the array. The function Programming Exercises 41 searches for the name in the array. If the name is found the U indicating that the name was not found in the array is // returned. Function String searchName(String name, String names[], Integer size) Declare Boolean found Declare Integer index Declare String result |/ Step through the array searching for the // specified name. While found == False AND index <= size="" -="" 1="" if="" contains(names="" [index],="" name)="" then="" set="" found="" true="" else="" set="" index="index" +="" 1="" end="" if="" end="" while="" determine="" the="" result.="" if="" found="=" true="" then="" set="" result="names[index]" else="" set="" result="That name was not found in the array." end="" if="" return="" result="" end="">

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here