Exam (2026/2027) | Actual Questions & Verified Answers |
100% Correct | Grade A+ | Guaranteed Pass!!
What is the loop variable initialization in the following pseudocode?
y = 0 s = 100.0 while y < 10 s = s + (s * 5.0) y = y + 1
Ay=0
By=y+1
C s = 100.0
D s = s + ( s * 5.0)
- ANSWER: A
What does the following algorithm determine? if x == y
z = 1 else z = 0
A Whether x and y are the same
B Whether x and y are negative
C Whether x is 1
D Whether x is 0
- ANSWER: A
What does the following algorithm accomplish?
x = Get next input if x == -1
Put "Goodbye" to output
A Outputs -1 when user types any input
B Outputs "x" when user types -1
1
, C Outputs -1 when x is positive
D Outputs Goodbye when user types -1
- ANSWER: D
Order the steps needed to output the minimum of x and y from first (1) to last (4).
Select your answers from the pull-down list.
A Declare variable min
B Put min to output
C min = x
D If y < min, set min = y
- ANSWER: ACDB
What does an output of 1 indicate for the following algorithm running on a five-
element list of integers?
i = 0 x = 0 while
i < 5 if list[i] < 0
x=1i
=i+1
Put x to output
A All integers are positive.
B All integers are negative.
C At least one integer is negative. D At least one integer is positive.
2
, - ANSWER: C
When should a programmer develop an algorithm to solve a problem?
A Before knowing the problem.
B Before writing a program to solve the problem.
C While writing a program to solve the problem. D After writing a program to
solve the problem .
- ANSWER: B
Which text represents an algorithm?
A Cats and dogs have tails.
B Insert key, turn key, open door.
C The forecast for tomorrow is rain.
D A box has balls, bats, and hats.
- ANSWER: B
Which operator should be used to determine if a number is evenly divisible by 5?
A+
B-C
*
D%
- ANSWER: %
3