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 // an integer specifying...



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


// an integer specifying the size of the array. The function


// searches for the name in the array. If the name is found, the


// string containing the name is returned; otherwise a message


// 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 <=>



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 Function

Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here