WGU D278 SCRIPTING AND
PROGRAMMING FOUNDATIONS FINAL
ASSESSMENT QUESTIONS WITH
VERIFIED ANSWERS AND DETAILED
EXPLANATIONS. 2026/2027
1. A developer is evaluating the expression ‘(x > 5) AND (y < 10 OR z == 7)’. If x = 6, y = 12, and
z = 7, what is the result of the expression?
A. Undefined
B. False
C. Null
D. True
Answer: D
Conceptual Explanation: Evaluating the expression: (6 > 5) is True. (12 < 10) is False, but
(7 == 7) is True. Thus, (False OR True) is True. Finally, (True AND True) results in True.
2. Which stage of the software development life cycle involves identifying the specific
features and constraints of a new software system?
A. Implementation
B. Analysis
,C. Design
D. Testing
Answer: B
Conceptual Explanation: The analysis phase focuses on understanding the user
requirements and defining what the system should do, including constraints and features.
3. What is the primary difference between a compiler and an interpreter?
A. A compiler executes code line-by-line, while an interpreter translates the whole program
first.
B. A compiler translates the entire source code into machine code before execution, while
an interpreter translates and executes it line-by-line.
C. Compilers are only used for low-level languages, while interpreters are for high-level
languages.
D. There is no difference; the terms are synonymous.
Answer: B
Conceptual Explanation: Compilers produce a standalone executable file by processing
the whole program at once, whereas interpreters process code on the fly.
4. In programming, what is a ‘logic error’?
A. An error where the program runs but produces incorrect or unexpected results.
B. An error that causes the program to crash immediately upon startup.
, C. An error that occurs when the code violates the rules of the programming language.
D. An error related to hardware failure during execution.
Answer: A
Conceptual Explanation: Logic errors occur when the program’s algorithm is flawed,
leading to incorrect output even though the code is syntactically correct.
5. Consider the following pseudocode: ‘Set x = 10; While x > 0: x = x - 3; Print x’. What is the
last value printed?
A. 1
B. -2
C. -1
D. 0
Answer: B
Conceptual Explanation: The loop iterations: x starts at 10. 10-3=7, 7-3=4, 4-3=1, 1-3=-2.
Since -2 is not > 0, the loop terminates after printing -2.
6. Which of the following data structures is most efficient for storing a fixed-size collection of
elements of the same type that can be accessed by an index?
A. Array
B. Linked List
C. Stack
PROGRAMMING FOUNDATIONS FINAL
ASSESSMENT QUESTIONS WITH
VERIFIED ANSWERS AND DETAILED
EXPLANATIONS. 2026/2027
1. A developer is evaluating the expression ‘(x > 5) AND (y < 10 OR z == 7)’. If x = 6, y = 12, and
z = 7, what is the result of the expression?
A. Undefined
B. False
C. Null
D. True
Answer: D
Conceptual Explanation: Evaluating the expression: (6 > 5) is True. (12 < 10) is False, but
(7 == 7) is True. Thus, (False OR True) is True. Finally, (True AND True) results in True.
2. Which stage of the software development life cycle involves identifying the specific
features and constraints of a new software system?
A. Implementation
B. Analysis
,C. Design
D. Testing
Answer: B
Conceptual Explanation: The analysis phase focuses on understanding the user
requirements and defining what the system should do, including constraints and features.
3. What is the primary difference between a compiler and an interpreter?
A. A compiler executes code line-by-line, while an interpreter translates the whole program
first.
B. A compiler translates the entire source code into machine code before execution, while
an interpreter translates and executes it line-by-line.
C. Compilers are only used for low-level languages, while interpreters are for high-level
languages.
D. There is no difference; the terms are synonymous.
Answer: B
Conceptual Explanation: Compilers produce a standalone executable file by processing
the whole program at once, whereas interpreters process code on the fly.
4. In programming, what is a ‘logic error’?
A. An error where the program runs but produces incorrect or unexpected results.
B. An error that causes the program to crash immediately upon startup.
, C. An error that occurs when the code violates the rules of the programming language.
D. An error related to hardware failure during execution.
Answer: A
Conceptual Explanation: Logic errors occur when the program’s algorithm is flawed,
leading to incorrect output even though the code is syntactically correct.
5. Consider the following pseudocode: ‘Set x = 10; While x > 0: x = x - 3; Print x’. What is the
last value printed?
A. 1
B. -2
C. -1
D. 0
Answer: B
Conceptual Explanation: The loop iterations: x starts at 10. 10-3=7, 7-3=4, 4-3=1, 1-3=-2.
Since -2 is not > 0, the loop terminates after printing -2.
6. Which of the following data structures is most efficient for storing a fixed-size collection of
elements of the same type that can be accessed by an index?
A. Array
B. Linked List
C. Stack