AND PROGRAMMING - FOUNDATIONS:
(LATEST 2026/2027 UPDATE), WITH
CORRECT/ACCURATE ANSWERS
WGU D278 FINAL EXAM PREP SCRIPTING
AND PROGRAMMING - FOUNDATIONS
Each question includes:
Multiple-choice options
Clearly marked correct answer
Deep rationale (3–5 sentences)
WGU D278 – Scripting and Programming
Foundations
Question 1
What are two primary purposes of using a programming library? (Choose two.)
A. To eliminate the need for debugging
B. To improve developer productivity
C. To add functionality focused on a specific purpose
D. To replace the operating system
✅ Correct Answers: B, C
Rationale:
Programming libraries provide prewritten, reusable code that allows developers to
complete tasks faster, improving productivity. They also add functionality tailored to
specific needs such as math operations, graphics, or database access. Libraries reduce
,the need to reinvent solutions for common problems. This results in cleaner, more
maintainable code.
Question 2
Which type of programming language generally executes faster?
A. Interpreted
B. Scripting
C. Compiled
D. Markup
✅ Correct Answer: C
Rationale:
Compiled languages are translated into machine code before execution, allowing them
to run directly on hardware. This removes the overhead of interpreting code at
runtime. As a result, compiled programs typically perform faster than interpreted
ones. Examples include C and C++.
Question 3
Which type of programming language is not written for a specific type of
machine?
A. Assembly
B. Compiled
C. Interpreted
D. Machine
✅ Correct Answer: C
,Rationale:
Interpreted languages are designed to be platform-independent, meaning they are not
tied to a specific hardware architecture. They rely on an interpreter to translate code
at runtime. This allows the same program to run on multiple systems. Python and
JavaScript are common examples.
Question 4
Which of the following programming languages are compiled? (Choose all that apply.)
A. Python
B. C
C. C++
D. Java
E. JavaScript
F. C#
✅ Correct Answers: B, C, D, F
Rationale:
Compiled languages convert source code into machine code or intermediate bytecode
before execution. C and C++ compile directly to machine code. Java and C# compile
into bytecode that runs on a virtual machine. This compilation step improves
performance and error detection.
Question 5
Which of the following languages support object-oriented programming
principles? (Choose all that apply.)
A. Python
B. JavaScript
C. C#
D. MATLAB
, E. C++
F. Java
✅ Correct Answers: A, B, C, D, E, F
Rationale:
All listed languages support object-oriented concepts such as encapsulation,
inheritance, and polymorphism. Some languages, like Java and C#, are purely object-
oriented. Others, such as Python and JavaScript, support multiple paradigms including
object-oriented programming. This flexibility makes them widely used.
Question 6
Which type of language does not allow a variable’s data type to change during
program execution?
A. Dynamically typed
B. Interpreted
C. Statically typed
D. Scripted
✅ Correct Answer: C
Rationale:
Statically typed languages require variables to have a fixed data type defined at
compile time. Once assigned, the type cannot change while the program runs. This
helps catch errors early and improves code reliability. Examples include Java and C++.
Question 7
Which type of programming language is generally considered easier for beginners to
use?