Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 30 pages
Exam (elaborations)

WGU D278 Scripting and Programming Foundations Exam Actual Exam 2026/2027 – Complete Exam-Style Questions | Detailed Rationales – Pass Guaranteed – A+ Graded

Document preview thumbnail
Preview 3 out of 30 pages

WGU D278 Scripting and Programming Foundations Exam Actual Exam 2026/2027 – Real-Style Questions with Answers | 100% Correct | Programming Fundamentals, Variables, Data Types, Control Structures, Functions | Graded A+ Verified | Scripting Languages, Syntax, Logic, Debugging, Problem-Solving, Algorithms | Detailed Rationales | Verified Correct Answers – Pass Guaranteed – Instant Download

Content preview

WGU D278 Scripting and Programming - Foundations (Latest 2026/2027 Update) | Questions and Verified Answers| 100% Correct| Grade A 2026/2027 | Page 1 | Passing Score: 80%




WESTERN GOVERNORS UNIVERSITY

WGU D278 Scripting and Programming - Foundations (Latest 2026/2027
Update) | Questions and Verified Answers| 100% Correct| Grade A
2026/2027 Edition -- Official Exam 2026/2027



75 80% N/A
QUESTIONS PASSING SCORE RECERTIFICATION




TABLE OF CONTENTS



Section 1 Programming Fundamentals and Logic Q1-Q15


Section 2 Data Types, Variables, and Operators Q16-Q30


Section 3 Control Structures (Loops and Conditionals) Q31-Q45


Section 4 Functions and Modular Programming Q46-Q60


Section 5 Arrays, Lists, and Basic Data Structures Q61-Q75




Instructions: Select the single best answer for each question. This exam is designed for WGU D278 Scripting and
Programming - Foundations certification preparation. Passing score: 80% (60 questions correct).




WGU D278 Scripting and Programming - Foundations -- 2026/2027 | Passing Score: 80% | Page 1

,SECTION 1 | Programming Fundamentals and Logic | Q1-Q15 | WGU D278 Scripting and Programming - Foundations 2026/2027




Q1 Question 1 of 75
Q1. A software developer is designing a program that converts temperatures from Fahrenheit to Celsius. The
developer writes out the step-by-step process before coding. This planning technique is known as creating what
type of document?
A. An algorithm, which is a finite set of unambiguous steps that solve a problem in a defined sequence
B. A compiler, which automatically translates the problem into executable machine code
C. A syntax diagram, which visually represents the grammar rules of the programming language
D. A debugger, which traces through code execution to identify logical errors

Correct Answer: A

Rationale:
An algorithm is a step-by-step procedure for solving a problem, and writing one before coding is a fundamental planning
technique. A compiler translates code but does not plan solutions, and a debugger finds errors after code is written.




Q2 Question 2 of 75
Q2. A student is learning about programming paradigms and encounters a language where the program is
structured as a sequence of instructions that execute in order. The student is working with which type of
programming paradigm?
A. The functional paradigm, where programs are composed of pure mathematical functions
B. The object-oriented paradigm, where programs model real-world entities as objects
C. The procedural paradigm, where programs are structured as sequences of executable statements
D. The declarative paradigm, where programs describe what should be computed rather than how

Correct Answer: C

Rationale:
Procedural programming organizes code as a linear sequence of statements executed in order. Functional programming
uses pure functions, object-oriented programming uses objects and classes, and declarative programming describes
outcomes rather than steps.




Q3 Question 3 of 75
Q3. A programmer encounters an error where the code runs without crashing but produces incorrect output. The
programmer reviews the logic and realizes the comparison operator was written as an assignment. What type of
error is this?
A. A syntax error, because the assignment operator cannot be used in a comparison context
B. A runtime error, because the program will eventually crash when the wrong value is accessed
C. A logical error, because the code compiles and runs but produces incorrect results due to flawed logic
D. A compilation error, because the compiler rejects the use of assignment in conditional statements

Correct Answer: C




WGU D278 Scripting and Programming - Foundations -- 2026/2027 | Passing Score: 80% | Page 2

, Rationale:
A logical error occurs when code compiles and runs without crashing but produces incorrect results because the algorithm or
logic is wrong. Syntax errors and compilation errors prevent code from running, while runtime errors cause the program to
crash during execution.




Q4 Question 4 of 75
Q4. A development team is reviewing a program and finds that variable names like x, y1, and temp make the
code difficult to understand. Which programming principle has been violated?
A. Code readability, because meaningful variable names make code easier to understand and maintain
B. Encapsulation, because the variables should be hidden inside classes
C. Polymorphism, because variables should be able to hold different data types
D. Inheritance, because variables should derive their names from parent classes

Correct Answer: A

Rationale:
Using descriptive variable names is a fundamental principle of code readability and maintainability. Encapsulation,
polymorphism, and inheritance are object-oriented concepts that are unrelated to variable naming conventions.




Q5 Question 5 of 75
Q5. A programmer writes pseudocode for a sorting algorithm and then translates it into Python. The pseudocode
serves which primary purpose in the software development process?
A. It serves as executable code that the interpreter can run directly without translation
B. It automatically generates test cases for verifying the correctness of the implementation
C. It compiles into machine code more efficiently than the actual programming language
D. It provides a language-independent representation of the algorithm that humans can easily read and
understand

Correct Answer: D

Rationale:
Pseudocode is a human-readable, language-independent way to express algorithms before implementation. It cannot be
executed by an interpreter or compiler, and it does not generate test cases or compile to machine code.




Q6 Question 6 of 75
Q6. A student is tracing through a program and encounters the expression 5 + 3 * 2. The student evaluates it as
16, but the computer returns 11. Which concept explains the difference between these results?
A. Type coercion, because the numbers are automatically converted to floating-point values
B. Short-circuit evaluation, because the second operand is skipped when the first is true
C. Integer overflow, because the result exceeds the maximum value for integer storage
D. Operator precedence, because multiplication is evaluated before addition in standard arithmetic order

Correct Answer: D




WGU D278 Scripting and Programming - Foundations -- 2026/2027 | Passing Score: 80% | Page 3

Document information

Uploaded on
June 5, 2026
Number of pages
30
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STUVIAACTUALEXAMS
3.5
(156)
Sold
1202
Followers
205
Items
8720
Last sold
10 hours ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions