• 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 38 pages
Exam (elaborations)

WGU D278 Scripting & Programming Foundations Objective Assessment Prep - | Grade A | Algorithmic Problem Solving

Document preview thumbnail
Preview 4 out of 38 pages

Prepare for your WGU D278 Scripting & Programming Foundations Objective Assessment with this comprehensive Prep resource for graded A. This essential guide covers algorithmic problem solving, programming logic, pseudocode development, computational thinking, and language-agnostic programming principles. Complete preparation for demonstrating competency in scripting and programming foundations at Western Governors University.

Content preview

WGU D278 Scripting & Programming Foundations
Objective Assessment Prep - 2026-2027 | Grade
A | Algorithmic Problem Solving

Each question mapped to official competency and written in WGU’s concise, code-first
style.



Competency 1 – Logic & Algorithmic Thinking (21 Qs)

Q1

Trace the pseudocode:

Copy

SET n ← 6
SET s ← 0
WHILE n > 0
s ← s + n
n ← n - 2
END WHILE
OUTPUT s


Output = ?

A. 12

B. 9

C. 20

D. 0

,Correct: A (12)

Competency: Trace iterative algorithms with numeric accumulators.

Rationale: 6+4+2 = 12; loop stops when n = 0.

Q2

How many comparisons are performed when this linear-search algorithm finds the
value 7 in list [3, 7, 1, 9]?

Copy

FOR i ← 0 TO LENGTH(list)-1
IF list[i] = 7 THEN OUTPUT i
END FOR


A. 1

B. 2

C. 3

D. 4

Correct: B (2)

Competency: Count algorithmic steps (comparisons).

Rationale: Index-0 (3≠7), Index-1 (7=7) → 2 comparisons.

Q3

Which sequence of steps correctly swaps the contents of variables x and y using a
temporary variable?

A. temp ← x; x ← y; y ← temp

,B. x ← y; temp ← x; y ← temp

C. temp ← x; y ← x; x ← temp

D. x ← x + y; y ← x - y; x ← x - y

Correct: A

Competency: Express basic sequential algorithms.

Rationale: Classic three-move sequence; other orders lose original x.

Q4

The algorithm below is intended to output the factorial of n (n!). Which logic error
exists?

Copy

SET result ← 1
FOR i ← 1 TO n
result ← result * i
END FOR


A. Loop should start at 0

B. result should be 0 initially

C. Loop runs one extra iteration

D. No error; algorithm is correct

Correct: D

Competency: Identify logic errors (here, none).

Rationale: 1×1×2×…×n = n!; standard solution.

, Q5

Desk-check the following flowchart fragment (described):

Decision diamond: “x MOD 2 = 0”

True arrow: OUTPUT “even”

False arrow: OUTPUT “odd”

Given x = 9, output = ?

A. even

B. odd

C. null

D. error

Correct: B (odd)

Competency: Interpret flowchart decision symbols.

Rationale: 9 mod 2 = 1 → False branch → “odd”.

Q6

An algorithm sums all integers from 1 to n. Which loop header guarantees correctness
for any positive integer n?

Copy

________
sum ← sum + i
END LOOP

Document information

Uploaded on
January 15, 2026
Number of pages
38
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.50

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.
PrimeScholars
3.3
(14)
Sold
116
Followers
0
Items
3846
Last sold
10 hours 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