Free WGU Scripting-and-Programming-Foundations Exam Practice Questions & Explanations

Last updated on: Aug 27, 2026
Prepared & Reviewed by the ValidExamDumps Editorial Team

At ValidExamDumps, we consistently monitor updates to the WGU Scripting-and-Programming-Foundations exam questions by WGU. Whenever our team identifies changes in the exam questions, objectives, focus areas or requirements, We immediately update our exam questions for both PDF and online practice exams. This commitment ensures our customers always have access to the most current and accurate questions. By preparing with these up to date and 100% exam domain coverage questions, our customers can successfully pass the WGU Scripting and Programming Foundations Exam exam on their first attempt without needing additional materials or study guides.

Other certification materials providers often include outdated or removed questions by WGU in their Scripting-and-Programming-Foundations exam. These outdated questions lead to customers failing their WGU Scripting and Programming Foundations Exam exam. In contrast, we ensure our questions bank includes only precise and up-to-date questions. Our main priority is your success in the WGU Scripting-and-Programming-Foundations exam, not profiting from selling obsolete exam questions in PDF or Online Practice Test.

 

Question 1

A programmer receives requirements from customers and decides to build a first version of a program. Which phase of an Agile approach is being carried out when the programmer starts writing the first version?

Answer Options
Correct Answer: A
Explanation

Comprehensive and Detailed Explanation From Exact Extract:

In Agile software development, the process is iterative, and writing code to create a version of the program occurs during the implementation phase. According to foundational programming principles and Agile methodologies (e.g., Certiport Scripting and Programming Foundations Study Guide, Agile Manifesto), implementation involves coding the software based on requirements and design.

Agile Phases Overview:

Analysis: Gathers and refines requirements (e.g., customer needs as user stories).

Design: Plans the technical solution (e.g., defining functions, classes, or architecture).

Implementation: Writes and integrates code to create a working version.

Testing: Verifies the code meets requirements.

Option A: 'Implementation.' This is correct. Starting to write the first version of the program involves coding, which is the core activity of the implementation phase. For example, the programmer might write functions or classes to meet customer requirements.

Option B: 'Testing.' This is incorrect. Testing occurs after coding to verify the program's functionality, not during the writing of the first version.

Option C: 'Design.' This is incorrect. Design involves planning the program's structure (e.g., specifying functions or objects), not writing the code.

Option D: 'Analysis.' This is incorrect. Analysis involves receiving and refining requirements, which the programmer has already done before starting to code.

Certiport Scripting and Programming Foundations Study Guide (Section on Agile Implementation).

Agile Manifesto: ''Working Software'' (http://agilemanifesto.org/).

Sommerville, I., Software Engineering, 10th Edition (Chapter 4: Agile Software Development).

Question 2

A program adds a service fee to the total cost of concert tickets when the tickets are printed and mailed to customers. Another service fee is also added if the tickets are delivered overnight. Which control structure should be used?

Answer Options
Correct Answer: D
Explanation

Comprehensive and Detailed Explanation From Exact Extract:

The program applies service fees based on two independent conditions: (1) if tickets are printed and mailed, and (2) if tickets are delivered overnight. According to foundational programming principles, multiple independent conditions are best handled by separate if statements, as each fee is applied conditionally and does not require iteration.

Option A: 'While loop.' This is incorrect. A while loop is used for repeated execution, but applying fees is a one-time decision per ticket order, not a repetitive task.

Option B: 'Do-while loop.' This is incorrect. A do-while loop guarantees at least one iteration, which is unnecessary here, as the fee application is a single check.

Option C: 'If statement.' This is incorrect. A single if statement can handle one condition, but two independent conditions (mailed and overnight) require separate checks.

Option D: 'Multiple if statements.' This is correct. Two if statements can independently check each condition and add the corresponding fee. For example, in Python:

total = ticket_cost

if mailed:

total += mail_fee

if overnight:

total += overnight_fee

Certiport Scripting and Programming Foundations Study Guide (Section on Control Structures: Conditionals).

Python Documentation: ''If Statements'' (https://docs.python.org/3/tutorial/controlflow.html#if-statements).

W3Schools: ''C If Statement'' (https://www.w3schools.com/c/c_if_else.php).

Question 3

What does a function definition consist of?

Answer Options
Correct Answer: D
Explanation

A function definition is the blueprint for a block of code designed to perform a specific task. Here's what it includes:

Function Name:A unique name to identify and call the function (e.g.,calculate_area).

Inputs (Parameters/Arguments):Values or variables passed into the function when it's called (e.g.,width,height).

Outputs (Return Value):The result the function produces after processing (e.g., the calculated area). This value may or may not be explicitly returned.

Statements (Function Body):Contains the code that performs the actions and calculations within the function.

Question 4

Given integer x = 12 and integer y = 4

What is the value of the expression x + y12?

Answer Options
Correct Answer: C
Explanation

The expression given is ( x + y^{12} ), with ( x = 12 ) and ( y = 4 ). To evaluate this expression, we substitute the values of ( x ) and ( y ) into the expression:

( x + y^{12} = 12 + 4^{12} )

Since ( 4^{12} ) is a very large number, the significant value in this expression comes from ( 4^{12} ), and the addition of 12 does not change the order of magnitude of the result. Therefore, the value of ( x + y^{12} ) is much greater than the options provided (A. 6, B. 8, C. 14). It seems there might be a typo in the expression or the options provided. If the expression was meant to be ( x + y \times 12 ), then the answer would be:

( x + y \times 12 = 12 + 4 \times 12 = 12 + 48 = 60 )

However, since this option is not available, and based on the provided options, the closest correct answer, assuming the expression is ( x + y ), would be:

( x + y = 12 + 4 = 16 )

But since 16 is not an option, and without further context, the best match from the given options would be C. 14, even though it is not the exact answer.


Basic arithmetic and algebraic principles.

Question 5

What is an accurate way to describe a statically typed language?

Answer Options
Correct Answer: D
Explanation

A statically typed language is one where the type of a variable is known at compile time. This means that the type of each variable must be declared and does not change throughout the program's execution. While this can lead to a larger number of variable declarations and sometimes conversions, it also allows for type checking at compile time, which can catch many errors before the program runs.Statically typed languages include Java, C, C++, and others123.


Baeldung on Computer Science provides a detailed comparison of statically and dynamically typed languages1.

Stack Overflow discussions offer insights into the characteristics of statically typed languages2.

Techopedia gives a concise definition of what it means for a language to be statically typed3.