his function finds the minimum number in a list. What should <MISSING CODE SEGMENT> be replaced
with in order for this function to operate as expected?function min(numList){ var min = numList[0];
for(var i=0; i<numList.length; i++){ if(numList[i] < min){ <MISSING CODE SEGMENT> } } return min;} -
Precise Answer ✔✔min = numList[i];
Is the following function is a good candidate to be placed in a library? - Precise Answer ✔✔No. It
references variables ( player1Points , player2Points ) that are most likely global variables in the original
program.
The drawCircle procedure is to be used to draw the following figure on a coordinate grid.
Which of the following code segments can be used to draw the figure?
Select two answers. - Precise Answer ✔✔x ← 4
y←1
r←0
REPEAT 3 TIMES{
drawCircle(x, y, r)
r←r+1
y←y+1
}
AND
x←4
y←4
r←3
REPEAT 3 TIMES{
drawCircle(x, y, r)
y←y-1
, r←r-1
}
//
x←4
y←4
r←3
REPEAT 3 TIMES{
drawCircle(x, y, r)
y←y-1
r←r-1
}
The following procedure was developed to determine if a list contains a negative number. If the list
contains a negative number it should return true, otherwise it should return false.
An error was made in writing this function so that it does not work as intended. Which line of code
would need to be fixed in order for the function to work as designed?
01 PROCEDURE checkNegative(list)02 {03 hasNegative <- true04 FOR EACH number IN list05 {06
IF(number < 0)07 {08 hasNegative <- true09 } 10 }11 RETURN(hasNegative)12 } - Precise Answer ✔✔line
03
A student has a data file containing 10,000 numerical values. The student is writing a program to
compute the average of the numbers contained in the file. Which of the following procedures is most
likely to be useful in the student's program? - Precise Answer ✔✔A procedure that returns the sum of
the values in the file
A/An ______ is the value passed to the parameter - Precise Answer ✔✔argument
A/An ______ is used to return the flow of control to the point where the procedure (also known as a
function) was called and to return the value of expression. - Precise Answer ✔✔return
Which of the following are benefits of procedural abstraction?