• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 50 pages
Exam (elaborations)

Wgu D278 Oa | Objective Assessment | 200 Questions And Answers | 2026 Update | 100% Correct

Document preview thumbnail
Preview 4 out of 50 pages

WGU D278 OA | OBJECTIVE ASSESSMENT | 200 QUESTIONS AND ANSWERS | 2026 UPDATE | 100% CORRECT

Content preview

1|Page


WGU D278 OA | OBJECTIVE ASSESSMENT | 200 QUESTIONS
AND ANSWERS | 2026 UPDATE | 100% CORRECT


1. A program receives an integer and must determine whether it is both positive
and evenly divisible by 3. Which Boolean expression correctly represents this
requirement?

A. number > 0 OR number % 3 == 0
B. number >= 0 AND number / 3 == 0
C. number > 0 AND number % 3 == 0
D. number < 0 AND number % 3 != 0

Answer: C. number > 0 AND number % 3 == 0
Rationale: The number must satisfy both conditions. The modulo operator
determines whether division by 3 leaves a remainder of zero.



2. Consider the following pseudocode:

x = 8
y = 3
z = x + y * 2

What is the value of z after execution?

A. 22
B. 14
C. 19
D. 11

Answer: B. 14
Rationale: Multiplication has higher precedence than addition, so y * 2 is
evaluated first: 3 * 2 = 6; then 8 + 6 = 14.

,2|Page


3. A programmer wants a loop to process every integer from 1 through 100 exactly
once. Which design presents the greatest risk of an off-by-one error if the
programmer intends the upper boundary to be included?

A. A loop beginning at 0 and continuing while the counter is less than 100
B. A loop beginning at 1 and continuing while the counter is less than or equal to
100
C. A loop beginning at 1 and stopping after the counter reaches 100
D. A loop beginning at 100 and decrementing until it reaches 1

Answer: A. A loop beginning at 0 and continuing while the counter is less than
100
Rationale: That loop processes 0 through 99 rather than 1 through 100,
demonstrating how boundary selection can produce an off-by-one error.



4. Consider:

total = 0
for i = 1 to 4
total = total + i
end for

What is the final value of total?

A. 6
B. 8
C. 10
D. 12

Answer: C. 10
Rationale: The accumulator receives 1 + 2 + 3 + 4, producing 10.



5. A developer observes that a program repeatedly executes a loop without ever
reaching the statement following the loop. The loop condition depends on a
counter, but the counter is never changed inside the loop. What is the most likely
problem?

,3|Page


A. Type conversion error
B. Infinite loop
C. Syntax error
D. Array indexing error

Answer: B. Infinite loop
Rationale: If the condition remains true because the controlling variable never
changes, the loop may execute indefinitely.



6. Consider:

x = 15

if x > 10
if x < 20
print("A")
else
print("B")
else
print("C")

What is displayed?

A. A
B. B
C. C
D. Nothing

Answer: A. A
Rationale: 15 > 10 is true, so the nested condition is evaluated. 15 < 20 is
also true, resulting in "A".



7. A function is declared as:

calculateAverage(score1, score2, score3)

A programmer calls it as:

, 4|Page


calculateAverage(80, 90)

What type of problem is most directly represented?

A. The function has received too few arguments for its defined parameters.
B. The function contains an infinite loop.
C. The function necessarily has a syntax error.
D. The function is using a Boolean operator incorrectly.

Answer: A. The function has received too few arguments for its defined
parameters.
Rationale: The function definition specifies three parameters, but the call supplies
only two arguments.



8. Which scenario best demonstrates modular programming?

A. Writing an entire application inside one very large function
B. Dividing a complex application into smaller functions that each perform a
specific responsibility
C. Replacing every variable with a constant
D. Removing comments to reduce program size

Answer: B. Dividing a complex application into smaller functions that each
perform a specific responsibility
Rationale: Modular programming decomposes a system into manageable,
reusable, and independently testable components.



9. An array contains:

[14, 7, 22, 9, 31]

If indexing begins at zero, which value is stored at index 3?

A. 7
B. 22
C. 9
D. 31

Document information

Uploaded on
September 4, 2026
Number of pages
50
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$20.24

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AceExam1
3.5
(11)
Sold
47
Followers
1
Items
3714
Last sold
2 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions