WGU D278 SCRIPTING AND
PROGRAMMING FOUNDATIONS FINAL
EXAM QUESTIONS WITH VERIFIED
ANSWERS 2026/2027
1. Which of the following best describes the primary function of a compiler?
A. It executes code line by line without prior translation.
B. It manages system memory and hardware resources during execution.
C. It translates the entire high-level source code into machine code before execution.
D. It provides a graphical interface for developers to write code.
Answer: C
Conceptual Explanation: A compiler translates the entire source code into machine
language or object code at once, whereas an interpreter translates it line by line during
execution.
2. In programming, what is the term for a logical error that allows a program to run but
produces incorrect results?
A. Syntax Error
B. Runtime Error
C. Compilation Error
,D. Semantic Error
Answer: D
Conceptual Explanation: Semantic errors, also known as logic errors, occur when the
program runs but does not behave as intended due to flawed logic.
3. Which data structure uses a First-In, First-Out (FIFO) approach?
A. Stack
B. Array
C. Tree
D. Queue
Answer: D
Conceptual Explanation: A queue is a linear data structure that follows the FIFO principle,
where the first element added is the first one removed.
4. What is the value of the expression (15 % 4) + (2 * 3)?
A. 9
B. 11
C. 12
D. 7
Answer: A
, Conceptual Explanation: 15 modulo 4 is 3. 2 multiplied by 3 is 6. 3 plus 6 equals 9.
5. Which of the following is a valid variable name in most programming languages?
A. _userScore
B. total-amount
C. 2nd_value
D. class
Answer: A
Conceptual Explanation: Variables usually cannot start with a number, contain hyphens,
or use reserved keywords like ‘class’. Starting with an underscore is generally permitted.
6. In the Software Development Life Cycle (SDLC), which phase involves creating flowcharts
and pseudocode?
A. Design
B. Analysis
C. Implementation
D. Testing
Answer: A
Conceptual Explanation: The Design phase focuses on planning the logic and structure of
the software using tools like flowcharts and pseudocode.
PROGRAMMING FOUNDATIONS FINAL
EXAM QUESTIONS WITH VERIFIED
ANSWERS 2026/2027
1. Which of the following best describes the primary function of a compiler?
A. It executes code line by line without prior translation.
B. It manages system memory and hardware resources during execution.
C. It translates the entire high-level source code into machine code before execution.
D. It provides a graphical interface for developers to write code.
Answer: C
Conceptual Explanation: A compiler translates the entire source code into machine
language or object code at once, whereas an interpreter translates it line by line during
execution.
2. In programming, what is the term for a logical error that allows a program to run but
produces incorrect results?
A. Syntax Error
B. Runtime Error
C. Compilation Error
,D. Semantic Error
Answer: D
Conceptual Explanation: Semantic errors, also known as logic errors, occur when the
program runs but does not behave as intended due to flawed logic.
3. Which data structure uses a First-In, First-Out (FIFO) approach?
A. Stack
B. Array
C. Tree
D. Queue
Answer: D
Conceptual Explanation: A queue is a linear data structure that follows the FIFO principle,
where the first element added is the first one removed.
4. What is the value of the expression (15 % 4) + (2 * 3)?
A. 9
B. 11
C. 12
D. 7
Answer: A
, Conceptual Explanation: 15 modulo 4 is 3. 2 multiplied by 3 is 6. 3 plus 6 equals 9.
5. Which of the following is a valid variable name in most programming languages?
A. _userScore
B. total-amount
C. 2nd_value
D. class
Answer: A
Conceptual Explanation: Variables usually cannot start with a number, contain hyphens,
or use reserved keywords like ‘class’. Starting with an underscore is generally permitted.
6. In the Software Development Life Cycle (SDLC), which phase involves creating flowcharts
and pseudocode?
A. Design
B. Analysis
C. Implementation
D. Testing
Answer: A
Conceptual Explanation: The Design phase focuses on planning the logic and structure of
the software using tools like flowcharts and pseudocode.