1.The process of hand-tracing code is valuable because Select one: a. It is usua
ID: 3679964 • Letter: 1
Question
1.The process of hand-tracing code is valuable because
Select one:
a. It is usually faster than just running the code.
b. It is the best way to design an algorithm.
c. You must already have a working program in order to do it.
d. It gives valuable insight that you do not get by running the code.
2.
Which loop does not check a condition at the beginning of the loop?
I. The do loop
II. The while loop
III. The for loop
Select one:
a. I and II
b. I and III
c. I only
d. III only
3.
In the following code snippet, when does the execution of the program switch from the inner loop to the outer loop?
Select one:
a. When the value of j becomes 5
b. When the program executes completely
c. When the condition for the outer loop is met
d. When the value of i is incremented
4.How many times does the loop execute in the following code fragment?
Select one:
a. 11
b. 12
c. 13
d. 14
What will be the final output of the following code snippet when a user enters input values in the order 10, 20, 30, 40, 50, and -1?
5. Select one:
a. The Average Salary: 0
b. The Average Salary: 30
c. The Average Salary: 24.83333
d. There will be no output as the code snippet will not compile.
Explanation / Answer
Answer 1 :-
option d : It gives valuable insight that you do not get by running the code.
Answer 2 :- Option c. The do loop
Answer 3 :- Option a. When the value of j becomes 5
Answer 4 :- Option c. 13 times
Answer 5 :- Option b. The Average Salary: 30
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.