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 4 out of 39 pages
Exam (elaborations)

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

Document preview thumbnail
Preview 4 out of 39 pages

WGU D278 Scripting and Programming Foundations Final 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

nal Exam Prep (Latest 2026/2027 Update) Scripting and Programming - Foundations | Questions and Verified Answers| 100% Correct| Grade A 2026/2027 | Page 1 | Passin



WESTERN GOVERNORS UNIVERSITY


WGU D278 Final Exam Prep
Scripting and Programming - Foundations
Questions and Verified Answers | 100% Correct | Grade A
2026/2027 Edition -- Official Exam 2026/2027
75 80% N/A

QUESTIONS PASSING SCORE RECERTIFICATION


INCLUDES DETAILED ANSWERS WITH RATIONALE FOR EVERY QUESTION
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 of 39

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


Q1 Question 1 of 75
A junior developer is writing a program and notices that the computer executes instructions
one after another in the exact order they appear in the source file. This sequential execution
model is best described as which fundamental programming concept?

A. Sequential execution where statements run in top-to-bottom order
B. Parallel execution where multiple statements run simultaneously
C. Event-driven execution where statements trigger on user actions only
D. Random execution where the interpreter chooses statement order arbitrarily


Correct Answer: A

Rationale:
Sequential execution is the fundamental model in which statements are executed one after another in the
order they appear in the source code. This is the default execution pattern in imperative programming.
Parallel, event-driven, and random execution describe fundamentally different models that require explicit
mechanisms to achieve.




Q2 Question 2 of 75
A student is learning about algorithms and is told that an algorithm must produce the same
output for the same input every time it runs. This property is known as which of the following?

A. Determinism meaning the algorithm always produces consistent and predictable results
B. Randomness meaning the algorithm generates different outputs to explore possibilities
C. Ambiguity meaning the algorithm can interpret inputs in multiple valid ways
D. Parallelism meaning the algorithm splits work across multiple processors simultaneously


Correct Answer: A

Rationale:
Determinism is the property that an algorithm will always produce the same output given the same input,
ensuring predictable and reproducible results. Randomness, ambiguity, and parallelism all describe
properties that are opposite to or inconsistent with the requirement for consistent outputs.




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

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


Q3 Question 3 of 75
A software engineer needs to represent a step-by-step procedure for solving a problem before
writing actual code. The engineer draws a flowchart with standard symbols including
rectangles for processes and diamonds for decisions. This visual representation is called
which of the following?

A. A flowchart that visually represents the logical flow and structure of an algorithm
B. Source code that the compiler translates directly into machine instructions
C. A database schema that defines relationships between tables and columns
D. A class diagram that shows object-oriented inheritance hierarchies


Correct Answer: A

Rationale:
A flowchart is a visual diagram that uses standardized symbols such as rectangles for processes and
diamonds for decisions to represent the logical flow of an algorithm. Source code is textual, a database
schema defines data structure, and a class diagram shows object relationships, none of which match the
described visual representation.




Q4 Question 4 of 75
A programmer writes a variable name as 'StudentGrade' where the first letter of each word is
capitalized and the words are joined together. This naming convention is known as which of
the following?

A. PascalCase where each word begins with an uppercase letter and words are concatenated
B. snake_case where words are separated by underscores and all letters are lowercase
C. camelCase where the first word starts lowercase and subsequent words start uppercase
D. kebab-case where words are separated by hyphens and all letters are lowercase


Correct Answer: A

Rationale:
PascalCase capitalizes the first letter of every word and concatenates them without separators, as in
StudentGrade. camelCase is similar but the first word starts with a lowercase letter. snake_case uses
underscores between lowercase words, and kebab-case uses hyphens which are not valid in most
programming language identifiers.




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

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


Q5 Question 5 of 75
A development team is discussing how to handle complexity in a large software project. The
lead architect suggests breaking the system into smaller, manageable pieces that can be
developed and tested independently. This approach is best described as which principle?

A. Decomposition where a complex problem is divided into smaller, more manageable
sub-problems
B. Encapsulation where data and methods are bundled together within a single class
C. Polymorphism where a single interface can represent different underlying forms
D. Inheritance where derived classes acquire properties from a parent class


Correct Answer: A

Rationale:
Decomposition is the principle of breaking a complex problem or system into smaller, more manageable
sub-problems that can be developed and tested independently. Encapsulation, polymorphism, and
inheritance are object-oriented programming concepts that address different aspects of software design.




Q6 Question 6 of 75
A programmer encounters a logic error in a program that compiles without any syntax errors
but produces incorrect output. The best way to identify and fix this type of error is which of the
following?

A. Trace through the program logic step by step comparing expected versus actual values
B. Fix all syntax errors first since logic errors cannot exist alongside syntax errors
C. Add more print statements to the source file to make it longer and more comprehensive
D. Rewrite the entire program from scratch because logic errors are irreparable


Correct Answer: A

Rationale:
Logic errors do not produce compilation errors but cause incorrect behavior, so the most effective approach
is to trace through the program step by step comparing expected values to actual values at each point.
Syntax errors are separate from logic errors, adding print statements indiscriminately does not
systematically solve the problem, and rewriting is unnecessary.




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

Document information

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

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