WGU Scripting-and-Programming-Foundations Practice Exam Questions & Answers
WGU Scripting-and-Programming-Foundations Exam Details
Key details for this exam, checked against the published exam outline
- Exam Code
- Scripting-and-Programming-Foundations
- Full Name
- WGU Scripting and Programming Foundations Exam
- Issuing Body
- Western Governors University
- Question Format (Our Bank)
- Multiple Choice, Hotspot
- Full Question Set
- 155 questions Get All Questions
Free Scripting-and-Programming-Foundations Practice Questions
Answer each question, then see the correct answer and why it is right
Question 1 Domain 2 Explaining Logic and Outcomes of Simple Algorithms
Examine the sequence diagram shown below:

What is the purpose of a sequence diagram?
A sequence diagram is a kind of interaction diagram used in software engineering to represent how objects communicate within a system across time. It displays the exchanges between objects and the sequence in which those exchanges take place. Objects are arranged horizontally to show their participation, while time progresses vertically down the diagram to show the order of interactions. As a result, the diagram captures both the interactions and the chronological order in which events happen12345.
Option B is incorrect because a sequence diagram does in fact define an order of events. Option C is incorrect since sequence diagrams do not depict static elements of software but instead the dynamic interactions. Option D is also incorrect because a sequence diagram does display every interaction together with their order.
Question 2 Domain 3 Scripting and Programming Foundations
Which output is produced when Greeting() is called two times?
Full Explanation Based on the Source Text:
The question does not include the definition of the Greeting() function, so some information is missing. Still, using common programming problem conventions and the answer choices, we presume Greeting() prints 'Hello!' whenever it runs. Under core programming concepts, running a function again repeats its output unless something about its state changes.
Premise: Greeting() prints 'Hello!' to the console (for example, in Python: def Greeting(): print('Hello!')).
Running Greeting() two times prints 'Hello!' twice, joined in the output stream as 'Hello!Hello!' (provided there are no extra line breaks or spaces, which is standard for such questions).
Option A: 'Hello!.' This is wrong. One call would produce a single 'Hello!', not two.
Option B: 'Hello!!.' This is wrong. It implies a changed output (for instance, an added exclamation mark), which the function's behavior does not suggest.
Option C: 'Hello!Hello!.' This is right. Two invocations of Greeting() each yield 'Hello!', which appear as 'Hello!Hello!' in the output.
Certiport Scripting and Programming Foundations Study Guide (Section on Function Calls and Output).
Python Documentation: ''Print Function'' (https://docs.python.org/3/library/functions.html#print).
W3Schools: ''C Output'' (https://www.w3schools.com/c/c_output.php).
Question 3 Domain 3 Scripting and Programming Foundations
Which type of data is a string designed to hold?
Within programming, a string holds a series of characters, such as letters, digits, symbols, and blank spaces.Strings are generally used to hold text, including individual words and full sentences12. As an illustration, the word ''positive'' would be saved as a string. Although a string may include digits, it does not hold numbers in their numeric form; instead, it holds them as text. Consequently, options A, C, and D, which refer to numbers or Boolean values, would not be saved as strings unless they are intended to be handled as text.
Get the complete Scripting-and-Programming-Foundations question set
$20$40
Question 4 Domain 2 Explaining Logic and Outcomes of Simple Algorithms
A developer has been brought in to build an inventory application for a library's book collection. Which phase of the Waterfall model is used to lay out every function that must be coded to support this inventory application?
Within the Waterfall development approach, the stage in which every function needed for the inventory application would be mapped out is the Design phase. This stage turns the requirements collected during analysis into a plan for building the system. It has two subphases: logical design and physical design.Logical design is the point where potential solutions are proposed and hypothesized, whereas physical design is when those conceptual ideas and schemas are converted into concrete specifications12.
The reasoning follows the standard Waterfall phases, which are Requirements, Design, Implementation, Verification, and Maintenance. Further details on these stages can be found in sources such as ''Waterfall Methodology: The Ultimate Guide to the Waterfall Model'' by ProjectManager1 and other educational platforms2.
Question 5 Domain 4 Using Fundamental Programming Elements
Which trait is particularly representative of an object-oriented programming language?
Object-oriented programming (OOP) is defined by bundling data and the operations that act on it into objects. This trait is central to OOP and sets it apart from procedural programming, which is organized around functions instead of objects. Within OOP, objects are created from classes, which specify the data (attributes) and the operations (methods) that may be applied to that data. Keeping data and methods together inside objects supports code that is more modular, reusable, and easier to maintain.
The features of object-oriented programming languages are widely documented and cover encapsulation, abstraction, inheritance, and polymorphism. These principles are foundational to OOP and are supported by languages like C++, Java, and Python12345.
Question 6 Domain 3 Scripting and Programming Foundations
During which stage of agile application development would a function be written that determines shipping charges using an item's weight and the destination zip code?
Within the Agile software development life cycle, the Implementation stage is when the actual coding and building of the project occur. This is the point at which a function that determines shipping charges from an item's weight and delivery zip code would be written. Implementation turns the design and analysis work into working software components. Developers write code and build features during this phase, and those features are later tested and refined in the following phases.
Agile methodologies stress incremental development and delivery, and the Implementation phase is central to building new functions1.
The Agile Software Development Life Cycle describes the Implementation phase as the stage where the actual product development takes place2.
Wrike's Agile Guide also characterizes the Implementation (or Iteration) phase as the time when the team constructs the software3.
Question 7 Domain 4 Using Fundamental Programming Elements
A procedure for computing the positive difference between two supplied values, x and y, follows the sequence of steps displayed.

Which pair of steps in this algorithm must be exchanged so that it runs successfully?
The algorithm only works if its steps occur in the right order. The variable Diff must be declared before any calculation references it. If Diff is declared at step 4 but used at step 1, the algorithm tries to access an undeclared variable and fails with an error. Swapping steps 1 and 4 guarantees that Diff is declared before any operation is performed on it.
Question 8 Domain 4 Using Fundamental Programming Elements
Which kind of data would a string be employed to hold?
Detailed Explanation Based on the Official Extract:
A string is a data type that holds a series of characters, such as text or words. Under standard programming principles (see the Certiport Scripting and Programming Foundations Study Guide), strings suit textual information but are not meant for numeric or Boolean values, which have their own data types (such as integers, floats, and booleans).
Option A: 'A true/false indication of whether a number is composite.' This is incorrect. A true/false value is a boolean rather than a string. In most languages (for example Python's True/False or C's 0/1), booleans form a separate type.
Option B: 'A positive number between 2 and 3.' This is incorrect. A number between 2 and 3 (such as 2.5) is a floating-point value, not a string. Strings can hold numbers written as text (such as '2.5'), but that is not their main purpose.
Option C: 'The word 'positive'.' This is correct. The word 'positive' is a sequence of characters, which makes it well suited to a string data type (for example char[] in C or str in Python).
Option D: 'A positive whole number.' This is incorrect. Whole numbers are stored as integers (for example int in C or Python), not as strings, unless written as text (such as '123'), which is not implied here.
Certiport Scripting and Programming Foundations Study Guide (Section on Data Types).
Python Documentation: ''Strings'' (https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str).
W3Schools: ''C Strings'' (https://www.w3schools.com/c/c_strings.php).
Practice every Scripting-and-Programming-Foundations question in the full set, each one with its verified answer and a detailed explanation
Get Full AccessWhat the WGU Scripting-and-Programming-Foundations Exam Covers
Exam domains verified against the Official WGU Scripting-and-Programming-Foundations exam guide, last checked November 2026.
Domain 1 Identifying Scripts for Computer Program Requirements
Choose the correct script or coding method for specific needs. Different scripts meet certain requirements and help identify suitable structures for solving defined programming tasks.
Domain 2 Explaining Logic and Outcomes of Simple Algorithms
Understand how simple algorithms function. Predict outcomes, follow logical steps, and see how basic instructions produce final results to build confidence in reading and interpreting algorithm behavior.
Domain 3 Scripting and Programming Foundations
Learn core principles of programming including variables, data types, flow control, and simple design ideas. Understand how various languages perform similar operations and the distinction between interpreted and compiled languages.
Domain 4 Using Fundamental Programming Elements
Apply essential programming components including variables, loops, conditions, and simple logic to perform common functions. Use these elements correctly to complete small programs in an organized and effective way.
Scripting-and-Programming-Foundations Exam FAQ
Common questions about the exam itself
What is the Scripting and Programming Foundations exam and who should take it?
What background do I need before attempting the Scripting and Programming Foundations exam?
Which objective area is typically the hardest part of the Scripting and Programming Foundations exam?
How long does it typically take to prepare for the Scripting and Programming Foundations exam?
What is the format of the Scripting and Programming Foundations exam?
Can I retake the Scripting and Programming Foundations exam if I don't pass?
How long is the Scripting and Programming Foundations certification valid after I pass?
What job roles does the Scripting and Programming Foundations exam prepare me for?
How does the Scripting and Programming Foundations exam relate to other WGU programming courses?
Other WGU Exams
Free practice questions for more WGU certification exams
