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

D278 Scripting and Programming Foundations Exam 2 2026/2027 - Control Structures Loops Functions Mastery 210 Q&A - A+ Graded - Latest Update This Year Just Released - Verified Solutions - Pass Guaranteed A+ VERIFIED WGU D278

Document preview thumbnail
Preview 4 out of 113 pages

D278 Exam 2 2026/2027 – Control Structures Loops Functions Mastery – Verified Solutions Just Released. 210 unique Q&A on if/else switch, for/while loops, break/continue, functions parameters return scope, modular programming. Code tracing output prediction. No duplication.

Content preview

, STUVIA EXAM LIBRARY
EXAMINATION DOCUMENT 2026/2027



D278 Scripting and Programming Foundations
Exam 2 2026/2027 - Control Structures Loops Functions Mastery
210 Q&A - A+ Graded - Latest Update This Year
Just Released - Verified Solutions - Pass Guaranteed

A+ VERIFIED
WGU D278




Focus: if else switch, loops for while, break continue, functions methods parameters return scope, modular programming

, TABLE OF CONTENTS
1. Section 1: Conditional Control Structures (Q1-40) - if, else, elif, switch, ternary, truthy/falsy, logical
operators
2. Section 2: Iterative Structures - For & While Loops (Q41-85) - range, sentinel, off-by-one, nested
loops, complexity
3. Section 3: Loop Interruption - Break & Continue Mastery (Q86-120) - break search, continue filter,
nested break
4. Section 4: Functions, Methods, Parameters, Return & Scope (Q121-175) - return vs print, LEGB,
closures, *args
5. Section 5: Modular Programming & Code Organization (Q176-210) - cohesion, coupling, import
system, DRY, API design

, D278 Exam 2 - Control Loops - {'A': 53, 'B': 53, 'C': 52, 'D': 52} Balanced
Distribution


1. [IF-ELSE-SWITCH - if-else evaluation] Scenario: For D278 control structures, consider
code involving if-else evaluation where input value is 3. Evaluate execution flow, variable
updates, and output prediction. Which statement correctly describes if-else evaluation
behavior under WGU OA exam conditions?
A. Correct. A conditional executes one branch based on boolean expression. If true, if block runs;
otherwise else block. This correctly handles if-else evaluation edge cases and expected OA logic.
B. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
if-else evaluation scenario (Option B).
C. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
if-else evaluation scenario (Option C).
D. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
if-else evaluation scenario (Option D).
Correct Answer: A
Rationale: The correct choice is A because A conditional executes one branch based on boolean expression. If true, if
block runs; otherwise else block. In programming fundamentals, this behavior aligns with how if-else evaluation is
evaluated at runtime. The misinterpreting fall-through, off-by-one, or scope options fail since they misinterpret initialization
condition update and scope chain. This distinction is critical for WGU D278 as it tests precise understanding of control
flow, scope, and modular design principles used in both Python and JavaScript.

2. [IF-ELSE-SWITCH - switch fall-through] Scenario: For D278 control structures, consider
code involving switch fall-through where input value is 6. Evaluate execution flow, variable
updates, and output prediction. Which statement correctly describes switch fall-through
behavior under WGU OA exam conditions?
A. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
switch fall-through scenario (Option A).
B. Correct. Switch evaluates expression once then jumps to matching case without break fall-through
executes next cases. This correctly handles switch fall-through edge cases and expected OA logic.
C. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
switch fall-through scenario (Option C).
D. Incorrect: Assumes misinterpreting fall-through, off-by-one, or scope that would cause logic error in
switch fall-through scenario (Option D).
Correct Answer: B
Rationale: The correct choice is B because Switch evaluates expression once then jumps to matching case without break
fall-through executes next cases. In programming fundamentals, this behavior aligns with how switch fall-through is
evaluated at runtime. The misinterpreting fall-through, off-by-one, or scope options fail since they misinterpret initialization
condition update and scope chain. This distinction is critical for WGU D278 as it tests precise understanding of control
flow, scope, and modular design principles used in both Python and JavaScript. WGU D278 emphasizes tracing,
desk-check, understanding Python JS differences, scope lifetime, parameter passing, return semantics, and modular
decomposition for maintainability and testability.

3. [IF-ELSE-SWITCH - truthy falsy] Scenario: For D278 control structures, consider code
involving truthy falsy where input value is 9. Evaluate execution flow, variable updates, and
output prediction. Which statement correctly describes truthy falsy behavior under WGU OA

Document information

Uploaded on
October 11, 2026
Number of pages
113
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
CA$21.88

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.
GradeAchiver
2.3
(4)
Sold
40
Followers
2
Items
3426
Last sold
17 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