WGU D278 SCRIPTING AND PROGRAMMING
FOUNDATIONS OBJECTIVE ASSESSMENT
STUDY GUIDE | LATEST UPDATE 2026/2027 |
PRACTICE QUESTIONS AND ANSWERS | EXAM
REVIEW | 100% CORRECT ANSWERS |
VERIFIED SOLUTIONS
This comprehensive practice examination is designed for students preparing for
the WGU D278 Scripting and Programming Foundations Objective Assessment. It
serves as a complete study guide and exam review, reflecting the latest update for
2026/2027. The questions are meticulously crafted to mirror the difficulty,
scenario-based style, and scope of the assessment, covering all essential domains
including programming fundamentals and logic, data types, variables, and
operators, control structures (loops and conditionals), functions and modular
programming, and arrays, lists, and basic data structures. By engaging with these
practice questions and answers, candidates can assess their readiness, identify
knowledge gaps, and reinforce their understanding of critical programming
concepts. The detailed rationales provide verified solutions, ensuring a deep
comprehension of the material and enhancing the effectiveness of your preparation
for this competency-based assessment.
Table of Contents
1. Programming Fundamentals and Logic
2. Data Types, Variables, and Operators
3. Control Structures (Loops and Conditionals)
4. Functions and Modular Programming
5. Arrays, Lists, and Basic Data Structures
, 2
Question 1: A software developer is explaining the concept of algorithms to a new
team member. She describes an algorithm as a finite set of well-defined
instructions that produces a result and terminates after a specific number of steps.
This definition emphasizes which fundamental property of algorithms?
A) Finiteness
B) Determinism
C) Efficiency
D) Generality
Correct Answer: A
Finiteness is the property that an algorithm must terminate after a finite number of
steps. Determinism means each step has exactly one next step. Efficiency refers to
resource usage. Generality means the algorithm applies to a class of problems, not
just one specific input.
Question 2: A programmer writes a flowchart that includes a diamond-shaped
symbol at a decision point where the process can follow two different paths. This
diamond symbol represents which programming concept?
A) A process or computation step
B) A decision or conditional branch
C) An input or output operation
D) A terminal start or end point
Correct Answer: B
In flowchart notation, a diamond shape represents a decision point where the flow
can branch based on a condition (true/false or yes/no). Rectangles represent
processes, parallelograms represent input/output, and ovals represent terminals
(start/end).
Question 3: A student is learning about programming paradigms and encounters
the term "declarative programming." The instructor explains that in declarative
programming, the programmer describes what the program should accomplish
rather than how to accomplish it. Which of these is an example of a declarative
approach?
, 3
A) Writing a loop that iterates through a list to find a maximum value
B) Writing a function that manually sorts an array using bubble sort
C) Writing a SQL query that selects records where age is greater than 30
D) Writing a recursive function to compute factorial
Correct Answer: C
Declarative programming is a language where you specify what data you want
(records where age > 30) without specifying how the database engine should
retrieve it. The other options all describe the step-by-step procedure (how), which
is characteristic of imperative programming.
Question 4: A development team is discussing the software development life
cycle. The team lead explains that identifying what the software needs to do and
documenting those requirements happens before any code is written. This
describes which phase?
A) Design
B) Implementation
C) Requirements gathering
D) Testing
Correct Answer: C
Requirements gathering is the phase where the team identifies and documents what
the software needs to do. Design follows requirements. Implementation is coding.
Testing verifies the software works as intended.
Question 5: What is the primary purpose of pseudocode in the programming
process?
A) To create executable code
B) To describe an algorithm in plain language without syntax constraints
C) To test code performance
D) To compile a program
Correct Answer: B
Pseudocode is a plain-language description of an algorithm that helps
programmers plan logic without worrying about specific syntax rules. It is not
executable, does not test performance, and is not compiled.
, 4
Question 6: A programmer is writing a program that needs to determine whether a
user is eligible to vote. The user must be at least 18 years old and a U.S. citizen.
Which type of logical operator is needed to combine these conditions?
A) OR
B) AND
C) NOT
D) XOR
Correct Answer: B
The AND operator requires both conditions to be true: the user must be at least 18
AND a U.S. citizen. OR would allow eligibility with just one condition. NOT
negates a condition. XOR requires exactly one condition to be true.
Question 7: What is the primary function of a compiler?
A) To execute code line by line
B) To translate source code into machine code all at once
C) To interpret code at runtime
D) To debug code
Correct Answer: B
A compiler translates the entire source code into machine code before execution.
An interpreter translates and executes code line by line. Debugging is a separate
process.
Question 8: A programmer writes a program that reads a temperature in Celsius
and converts it to Fahrenheit. The formula is F = (C × 9/5) + 32. Which type of
operation is being performed?
A) Input and output
B) Arithmetic
C) String manipulation
D) Boolean logic
Correct Answer: B
The conversion involves multiplication, division, and addition, which are