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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
question
Computers and Technology, 24.06.2019 10:20
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
You know the right answer?
A programmer wrote the program below. The program uses a list of numbers called numList. The program...
Questions
question
Mathematics, 03.03.2021 19:50
question
Mathematics, 03.03.2021 19:50
question
English, 03.03.2021 19:50
question
Mathematics, 03.03.2021 19:50
question
Mathematics, 03.03.2021 19:50