Discover new knowledge and insights with IDNLearn.com's extensive Q&A database. Discover comprehensive answers to your questions from our community of experienced professionals.
The following procedure is intended to return true if the list of numbers myList contains only positive numbers and is intended to return false otherwise. The procedure does not work as intended.
PROCEDURE allPositive(myList)
{
index ← 1
len ← LENGTH(myList)
REPEAT len TIMES
{
IF(myList[index] > 0)
{
RETURN(true)
}
index ← index + 1
}
RETURN(false)
}
For which of the following contents of myList does the procedure NOT return the intended result?
Responses
[-3, -2, -1]
[-3, -2, -1]
[-2, -1, 0]
[-2, -1, 0]
[-1, 0, 1]
[-1, 0, 1]
[1, 2, 3]
Sagot :
We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. Your search for solutions ends here at IDNLearn.com. Thank you for visiting, and come back soon for more helpful information.