WGU D278 SCRIPTING AND
PROGRAMMING FOUNDATIONS -
ADVANCED PRACTICE EXAM
QUESTIONS WITH VERIFIED ANSWERS
2026/2027
1. An algorithm is defined as a series of well-defined steps for solving a problem. Which
characteristic is essential for an algorithm to be considered robust?
A. It must produce the same output for the same input every time.
B. It must include at least one loop structure.
C. It must be written in a specific high-level programming language.
D. It must be capable of running without any hardware constraints.
Answer: A
Conceptual Explanation: Determinism is a key characteristic of algorithms; they must
provide consistent results given the same starting conditions.
2. In the Software Development Life Cycle (SDLC), which phase primarily focuses on
determining what the system should do from a user perspective?
A. Implementation
B. Design
,C. Analysis
D. Maintenance
Answer: C
Conceptual Explanation: The Analysis phase involves gathering requirements and
defining the system’s purpose and constraints.
3. Which flowchart symbol is used to represent a decision point that branches into two or
more paths?
A. Rectangle
B. Oval
C. Diamond
D. Parallelogram
Answer: C
Conceptual Explanation: A diamond shape represents a conditional or decision node in a
flowchart.
4. A developer is writing pseudocode: ‘Set x to 10; Set y to 20; Set x to x + y; Set y to x - y; Set
x to x - y;’. What are the final values of x and y?
A. x = 10, y = 20
B. x = 30, y = 30
C. x = 20, y = 10
, D. x = 10, y = 10
Answer: C
Conceptual Explanation: This is a standard swap algorithm using arithmetic: x becomes
30, then y becomes 30-20=10, then x becomes 30-10=20.
5. Which of the following describes a compiled language correctly?
A. The code is executed line-by-line by a separate program at runtime.
B. It is strictly used for web scripting like HTML.
C. It does not require any translation before running on a CPU.
D. The code is converted entirely into machine code before execution.
Answer: D
Conceptual Explanation: Compilers translate the entire source code into machine-
executable binary files before the program runs.
6. What is the primary purpose of a ‘Constant’ in programming?
A. To store data that changes frequently during execution.
B. To serve as a placeholder for user input.
C. To represent values that remain unchanged throughout the program’s life.
D. To manage memory allocation for dynamic arrays.
Answer: C
PROGRAMMING FOUNDATIONS -
ADVANCED PRACTICE EXAM
QUESTIONS WITH VERIFIED ANSWERS
2026/2027
1. An algorithm is defined as a series of well-defined steps for solving a problem. Which
characteristic is essential for an algorithm to be considered robust?
A. It must produce the same output for the same input every time.
B. It must include at least one loop structure.
C. It must be written in a specific high-level programming language.
D. It must be capable of running without any hardware constraints.
Answer: A
Conceptual Explanation: Determinism is a key characteristic of algorithms; they must
provide consistent results given the same starting conditions.
2. In the Software Development Life Cycle (SDLC), which phase primarily focuses on
determining what the system should do from a user perspective?
A. Implementation
B. Design
,C. Analysis
D. Maintenance
Answer: C
Conceptual Explanation: The Analysis phase involves gathering requirements and
defining the system’s purpose and constraints.
3. Which flowchart symbol is used to represent a decision point that branches into two or
more paths?
A. Rectangle
B. Oval
C. Diamond
D. Parallelogram
Answer: C
Conceptual Explanation: A diamond shape represents a conditional or decision node in a
flowchart.
4. A developer is writing pseudocode: ‘Set x to 10; Set y to 20; Set x to x + y; Set y to x - y; Set
x to x - y;’. What are the final values of x and y?
A. x = 10, y = 20
B. x = 30, y = 30
C. x = 20, y = 10
, D. x = 10, y = 10
Answer: C
Conceptual Explanation: This is a standard swap algorithm using arithmetic: x becomes
30, then y becomes 30-20=10, then x becomes 30-10=20.
5. Which of the following describes a compiled language correctly?
A. The code is executed line-by-line by a separate program at runtime.
B. It is strictly used for web scripting like HTML.
C. It does not require any translation before running on a CPU.
D. The code is converted entirely into machine code before execution.
Answer: D
Conceptual Explanation: Compilers translate the entire source code into machine-
executable binary files before the program runs.
6. What is the primary purpose of a ‘Constant’ in programming?
A. To store data that changes frequently during execution.
B. To serve as a placeholder for user input.
C. To represent values that remain unchanged throughout the program’s life.
D. To manage memory allocation for dynamic arrays.
Answer: C