subject

A programmer wrote the program below. The program uses a list of numbers called numList. The program is intended to display the sum of the numbers in the list. In order to test the program, the programmer initializes numList to [0, 1, 4, 5].
The program displays 10, and the programmer concludes that the program works as intended.

set! sum = numList [1]
FOR EACH value IN numList
set! sum = sum + value
DISPLAY sum

Which of the following is true?

A) The conclusion is correct; the program works as intended.
B) The conclusion is incorrect; the program does not display the correct value for the test case [0, 1, 4, 5].
C) The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.
D) The conclusion is incorrect; using the test case [0, 1, 4, 5] only confirms that the program works for lists in increasing order.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 16:00, CalCDanG
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
image
Computers and Technology, 24.06.2019 18:20, seema12
7. design a circuit with three inputs (x, y, and z) representing the bits in a binary number, and three outputs (a, b, and c) also representing bits in a binary number. when the input is 1, 2, or 3, the binary output should be one lesser than the input. when the input is 4, 5, or 6, the binary output should be one greater than the input. when the input is 0, the output is 0, and when the input is 7, the output is 7. show your truth table, all computations for simplification, and the final circuit.
Answers: 2
image
Computers and Technology, 24.06.2019 19:00, stephanieanaya7
In python a floating-point number must be written using scientific notation?
Answers: 1
image
Computers and Technology, 25.06.2019 05:10, andyboehm7411
What is the disadvantage of a mesh topology?
Answers: 1
You know the right answer?
A programmer wrote the program below. The program uses a list of numbers called numList. The program...

Questions in other subjects:

Konu
Mathematics, 18.02.2020 22:02
Konu
Mathematics, 18.02.2020 22:02