subject

Assume the following main module is in a program that includes the binarysearch function that was shown in this chapter. why doesn't the pseudocode in the main module work?

// this program uses the binarysearch function to search for a
// name in the array. this program assumes the binarysearch
// function has already been defined.

module main()
constant integer size = 5
declare string names[size] = "zack", "james", "pam", "marc", "susan"
declare string searchname
declare integer index
display "enter a name to search for."
input searchname
set index = binarysearch(names, searchname, size)
if index ! = -1 then
display searchname, " was found."
else
display searchname, " was not found."
end if
end module

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 25.06.2019 10:30
Why does the hp computer not have bluetooth?
Answers: 1
question
Computers and Technology, 25.06.2019 19:00
Assume you're running a query on your orders in the past year. you want to see how many orders were placed after may. what type of query would you use to find this data? a. select b. range c. complex d. parameter
Answers: 1
question
Computers and Technology, 25.06.2019 19:30
Which animation effects allow text or images to show movement on a slide? check all that apply. - enterance - emphasis - exit - motion paths - add-in - insert
Answers: 1
question
Computers and Technology, 26.06.2019 08:00
Why is manual coding the best way to learn html? plz asap
Answers: 2
You know the right answer?
Assume the following main module is in a program that includes the binarysearch function that was sh...
Questions
question
Mathematics, 15.09.2021 08:30
question
Mathematics, 15.09.2021 08:40
question
Mathematics, 15.09.2021 08:40
Questions on the website: 13722363