A procedure is a set of code that is referred to by name and can be called (invoked) at any point in a program simply by utilizing the procedure’s name.
In some languages, a procedure could be called a method or subroutine.
The purpose of the above procedure is to append all negative numbers in aList into bList.
Line 3 iterates through aList.
If the element in aList is less than 0, line 5 causes the element to be appended into bList.
A call to keepPositive(aList, bList) where aList[2, −5, −11, 6] and bList[ ] would result in bList containing the numbers [−5, −11].