WGU D278 SCRIPTING AND PROGRAMING FOUNDATIONS OBJECTIVE
ASSESSMENT EXAM – QUESTIONS AND ANSWERS | VERIFIED AND WELL
DETAILED ANSWERS | EXAM TESTBANK | PLUS RATIONALES | DOWNLOAD
AND PASS | LATEST EXAM UPDATE 2026/2027
Core Domains
• Programming Fundamentals and Logic
• Variables, Data Types, and Operators
• Control Structures (Conditionals and Loops)
• Functions, Scope, and Modularity
• Data Structures (Lists, Arrays, Dictionaries)
• Object-Oriented Programming (OOP) Principles
• Algorithms and Problem-Solving
• Debugging, Testing, and Error Handling
Introduction
This comprehensive examination is designed to rigorously assess your foundational
knowledge and practical skills in scripting and programming as defined by the
WGU D278 curriculum. The test evaluates your understanding of core concepts,
from basic syntax and control flow to more complex topics like object-oriented
programming and algorithm design. Through a series of multiple-choice and
scenario-based questions, you will be required to apply theoretical knowledge to
realistic coding challenges and professional decision-making scenarios. This
assessment emphasizes not only the ability to recall facts but also to analyze
problems, evaluate code, and determine the most efficient and appropriate
programming solutions. The questions reflect the critical thinking and practical
application necessary for success in a professional programming environment.
,SECTION ONE: QUESTIONS 1-50
1. In the context of programming, what is the primary purpose of a high-level
language?
A. To provide a human-readable abstraction of machine code
B. To execute code directly on the processor
C. To manage computer hardware resources
D. To convert source code to binary
🟢 Correct Answer: A. To provide a human-readable abstraction of machine code
🔴 Explanation: High-level languages use syntax and structures that are closer to
human language, making them easier to read, write, and understand. This
abstraction layers over the underlying machine code.
2. A software developer is tasked with writing a program to calculate the
average temperature for the past week. Which of the following is the most
appropriate data structure to initially store the daily temperatures?
A. A stack
B. A linked list
C. A tuple
D. A dictionary
🟢 Correct Answer: C. A tuple
🔴 Explanation: The daily temperatures represent a fixed, ordered collection of
seven numbers. A tuple is an immutable, ordered sequence, which is ideal for
storing a static set of related data points where the data itself won't be changed
after creation.
3. What is the value of the Boolean expression
(True and False) or (True and True) ?
A. False
,B. True
C. None
D. Error
🟢 Correct Answer: B. True
🔴 Explanation: First, evaluate the AND operators: (True and False) is False,
and (True and True) is True. Then, evaluate False or True , which results in
True.
4. Consider the following pseudocode: x = 10, y = 3, result = x % y . What
is the value of result ?
A. 3
B. 1
C. 3.33
D. 0
🟢 Correct Answer: B. 1
🔴 Explanation: The % operator is the modulus operator; it returns the
remainder of a division operation. 10 divided by 3 is 3 with a remainder of 1.
Therefore, the result is 1.
5. Which of the following situations is the most appropriate use case for a
"while" loop?
A. Iterating through a list to sum its elements
B. Displaying the menu options for a program
C. Re-prompting a user for input until they provide a valid entry
D. Executing a block of code exactly ten times
🟢 Correct Answer: C. Re-prompting a user for input until they provide a valid
entry
, 🔴 Explanation: A "while" loop is designed for indefinite iteration; it continues as
long as a specified condition is true. Re-prompting a user until they give valid
input is a classic scenario where the exact number of iterations is not known in
advance.
6. In object-oriented programming, what principle is exemplified by a single
object being able to take on many forms?
A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction
🟢 Correct Answer: C. Polymorphism
🔴 Explanation: Polymorphism allows objects of different classes to be treated as
objects of a common superclass. More specifically, it allows the same method
name to be used on different types of objects, with each object responding in its
own way. This is the literal meaning of "many forms."
7. Which of the following is a key responsibility of an Integrated Development
Environment (IDE)?
A. Compiling source code into machine code exclusively
B. Providing a single, integrated tool for coding, debugging, and testing
C. Maintaining the organization's network infrastructure
D. Designing the user interface of a web application
🟢 Correct Answer: B. Providing a single, integrated tool for coding, debugging,
and testing
🔴 Explanation: An IDE enhances developer productivity by providing a unified
environment that includes a code editor, build automation tools, a debugger, and
sometimes a compiler or interpreter, all within a single application.
ASSESSMENT EXAM – QUESTIONS AND ANSWERS | VERIFIED AND WELL
DETAILED ANSWERS | EXAM TESTBANK | PLUS RATIONALES | DOWNLOAD
AND PASS | LATEST EXAM UPDATE 2026/2027
Core Domains
• Programming Fundamentals and Logic
• Variables, Data Types, and Operators
• Control Structures (Conditionals and Loops)
• Functions, Scope, and Modularity
• Data Structures (Lists, Arrays, Dictionaries)
• Object-Oriented Programming (OOP) Principles
• Algorithms and Problem-Solving
• Debugging, Testing, and Error Handling
Introduction
This comprehensive examination is designed to rigorously assess your foundational
knowledge and practical skills in scripting and programming as defined by the
WGU D278 curriculum. The test evaluates your understanding of core concepts,
from basic syntax and control flow to more complex topics like object-oriented
programming and algorithm design. Through a series of multiple-choice and
scenario-based questions, you will be required to apply theoretical knowledge to
realistic coding challenges and professional decision-making scenarios. This
assessment emphasizes not only the ability to recall facts but also to analyze
problems, evaluate code, and determine the most efficient and appropriate
programming solutions. The questions reflect the critical thinking and practical
application necessary for success in a professional programming environment.
,SECTION ONE: QUESTIONS 1-50
1. In the context of programming, what is the primary purpose of a high-level
language?
A. To provide a human-readable abstraction of machine code
B. To execute code directly on the processor
C. To manage computer hardware resources
D. To convert source code to binary
🟢 Correct Answer: A. To provide a human-readable abstraction of machine code
🔴 Explanation: High-level languages use syntax and structures that are closer to
human language, making them easier to read, write, and understand. This
abstraction layers over the underlying machine code.
2. A software developer is tasked with writing a program to calculate the
average temperature for the past week. Which of the following is the most
appropriate data structure to initially store the daily temperatures?
A. A stack
B. A linked list
C. A tuple
D. A dictionary
🟢 Correct Answer: C. A tuple
🔴 Explanation: The daily temperatures represent a fixed, ordered collection of
seven numbers. A tuple is an immutable, ordered sequence, which is ideal for
storing a static set of related data points where the data itself won't be changed
after creation.
3. What is the value of the Boolean expression
(True and False) or (True and True) ?
A. False
,B. True
C. None
D. Error
🟢 Correct Answer: B. True
🔴 Explanation: First, evaluate the AND operators: (True and False) is False,
and (True and True) is True. Then, evaluate False or True , which results in
True.
4. Consider the following pseudocode: x = 10, y = 3, result = x % y . What
is the value of result ?
A. 3
B. 1
C. 3.33
D. 0
🟢 Correct Answer: B. 1
🔴 Explanation: The % operator is the modulus operator; it returns the
remainder of a division operation. 10 divided by 3 is 3 with a remainder of 1.
Therefore, the result is 1.
5. Which of the following situations is the most appropriate use case for a
"while" loop?
A. Iterating through a list to sum its elements
B. Displaying the menu options for a program
C. Re-prompting a user for input until they provide a valid entry
D. Executing a block of code exactly ten times
🟢 Correct Answer: C. Re-prompting a user for input until they provide a valid
entry
, 🔴 Explanation: A "while" loop is designed for indefinite iteration; it continues as
long as a specified condition is true. Re-prompting a user until they give valid
input is a classic scenario where the exact number of iterations is not known in
advance.
6. In object-oriented programming, what principle is exemplified by a single
object being able to take on many forms?
A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction
🟢 Correct Answer: C. Polymorphism
🔴 Explanation: Polymorphism allows objects of different classes to be treated as
objects of a common superclass. More specifically, it allows the same method
name to be used on different types of objects, with each object responding in its
own way. This is the literal meaning of "many forms."
7. Which of the following is a key responsibility of an Integrated Development
Environment (IDE)?
A. Compiling source code into machine code exclusively
B. Providing a single, integrated tool for coding, debugging, and testing
C. Maintaining the organization's network infrastructure
D. Designing the user interface of a web application
🟢 Correct Answer: B. Providing a single, integrated tool for coding, debugging,
and testing
🔴 Explanation: An IDE enhances developer productivity by providing a unified
environment that includes a code editor, build automation tools, a debugger, and
sometimes a compiler or interpreter, all within a single application.