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
Exam (elaborations)

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

Rating
-
Sold
-
Pages
39
Grade
A+
Uploaded on
05-06-2026
Written in
2025/2026

WGU D278 Scripting and Programming Foundations Pre-Assessment V2 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

Show more Read less
Institution
WGU D278 Scripting And Programming Foundations
Course
WGU D278 Scripting and Programming Foundations

Content preview

Assessment V2 (Latest 2026/2027 Update) Scripting and Programming - Foundations | Questions and Verified Answers| 100% Correct| Grade A 2026/2027 | Page 1 | Pas



WESTERN GOVERNORS UNIVERSITY


WGU D278 Pre-Assessment V2 (Latest 2026/2027 Update)
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


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 software development team is designing a program that converts Celsius temperatures to
Fahrenheit. The team lead asks a junior developer to identify the correct formula for this
conversion. The junior developer recalls that the formula involves multiplying by 9/5 and
adding 32. In what order should these operations be applied?

A. Add 32 to the Celsius value first, then multiply by 9/5
B. Multiply the Celsius value by 5/9 first, then add 32 to the result
C. Multiply the Celsius value by 9/5 first, then add 32 to the result
D. Add 32 to the Celsius value first, then multiply by 5/9


Correct Answer: C

Rationale:
The standard formula for converting Celsius to Fahrenheit is F = (C x 9/5) + 32. Multiplication by 9/5 is
performed first, followed by adding 32. Option B reverses the operation order, producing incorrect results.
Option C uses the wrong fraction 5/9, which is the reciprocal needed for the reverse conversion.




Q2 Question 2 of 75
A student is learning about algorithms and encounters a problem that requires sorting a small
list of five numbers. The instructor explains that one simple sorting method repeatedly steps
through the list, compares adjacent elements, and swaps them if they are in the wrong order.
What is the name of this sorting algorithm?

A. Selection sort
B. Insertion sort
C. Merge sort
D. Bubble sort


Correct Answer: D

Rationale:
Bubble sort works by repeatedly stepping through the list, comparing adjacent elements, and swapping them
if they are in the wrong order. This process is repeated until the list is sorted. Selection sort finds the
minimum element and places it at the beginning, while insertion sort builds the sorted list one element at a
time by inserting into the correct position.




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 developer is writing pseudocode for a program and needs to represent a decision point
where the program takes one action if a condition is true and a different action if the condition
is false. What programming construct should the developer use for this purpose?

A. A for loop
B. A while loop
C. An if-else statement
D. A variable assignment


Correct Answer: C

Rationale:
An if-else statement is the fundamental programming construct for implementing conditional branching,
where the program executes one block of code if a condition is true and a different block if it is false. A for
loop and while loop are used for iteration, not conditional branching. A variable assignment stores a value
but does not make decisions.




Q4 Question 4 of 75
A programmer needs to trace the logic of a flowchart that begins with a start symbol, followed
by a process box, then a decision diamond with two branches, and ends with a terminal
symbol. The decision diamond contains the expression 'x > 10'. What does the diamond
shape specifically represent in this flowchart?

A. An input or output operation
B. A process that modifies a variable
C. A conditional test that evaluates to true or false
D. The start or end of the program


Correct Answer: C

Rationale:
In flowchart notation, a diamond shape always represents a decision point where a condition is evaluated
and the flow branches based on whether the result is true or false. Rectangles represent processes,
parallelograms represent input/output, and rounded rectangles or ovals represent start/end terminals.




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 student encounters a problem where a program must compute the factorial of a number n,
defined as n x (n-1) x (n-2) x ... x 1. The student writes a solution where the function calls itself
with a smaller input until it reaches the base case of 1. What programming technique is the
student using?

A. Iteration
B. Polymorphism
C. Recursion
D. Encapsulation


Correct Answer: C

Rationale:
Recursion is a programming technique where a function calls itself with a modified input until it reaches a
base case. The factorial function is a classic example of recursion because f(n) = n * f(n-1). Iteration uses
loops instead of self-calling functions. Polymorphism and encapsulation are object-oriented concepts, not
related to this technique.




Q6 Question 6 of 75
A team of developers is reviewing code quality guidelines. One guideline states that variable
names should be descriptive and reflect the purpose of the variable rather than using
single-letter abbreviations. What principle of programming best practices does this guideline
support?

A. Code execution speed
B. Code readability and maintainability
C. Memory optimization
D. Algorithmic complexity reduction


Correct Answer: B

Rationale:
Descriptive variable names improve code readability by making it clear what each variable represents, which
in turn makes the code easier to maintain and debug. This has no direct impact on execution speed,
memory usage, or algorithmic complexity, which are separate performance considerations.




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

Written for

Institution
WGU D278 Scripting and Programming Foundations
Course
WGU D278 Scripting and Programming Foundations

Document information

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

Subjects

$16.49
Get access to the full document:

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

Get to know the seller

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 University Of California - Los Angeles (UCLA)
Follow You need to be logged in order to follow users or courses
Sold
1052
Member since
3 year
Number of followers
204
Documents
7578
Last sold
20 hours ago
Actual Exam

STUVIAACTUALEXAMS is a trusted exam-success delivering accurate, verified, and exam-focused study materials that include real exam-style questions, correct answers, and clear, easy-to-follow rationales, all professionally organized to save time, eliminate guesswork, reduce stress, boost confidence, and help students secure top grades and pass their exams on the first attempt with certainty and ease.

3.5

142 reviews

5
59
4
24
3
21
2
10
1
28

Recently viewed by you

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