Pre-Winter Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: pass65

Free Practice Questions for the WGU Courses and Certificates Scripting-and-Programming-Foundations Exam (2026 Updated)

At Marks4sure, we are dedicated to providing IT professionals with the most accurate and reliable preparation materials for the WGU Scripting-and-Programming-Foundations exam. To support your certification journey, we have made a selection of our premium 2026 Courses and Certificates practice questions and answers available completely free. You can take this practice test as many times as you need. Every question includes a detailed, expertly verified explanation to ensure you fully grasp the core security concepts before test day.

Questions 4

A program steps through an array and adds up all the numbers stored in the array. What is the appropriate individual control structure that should be used?

Options:

A.

One while loop

B.

Nested for loops

C.

Multiple if statements

D.

One for loop

Buy Now
Questions 5

What are two example of valid function calls?

Choose 2 answers.

Options:

A.

round_number(4.723, 2)

B.

convort_value(12) returns cVa1

C.

Printsample()

D.

CountFactors(96 integer)

E.

function Sample (float 2.0)

F.

GetHeight(integer 3, integer 4)

Buy Now
Questions 6

A particular sorting algorithm takes integer list [10, 6, 8] and incorrectly sorts the list to [6, 10, 8] . What is true about the algorithm’s correctness for sorting an arbitrary list of three integers?

Options:

A.

The algorithm is incorrect.

B.

The algorithm only works for [10, 6, 8].

C.

The algorithm’s correctness is unknown.

D.

The algorithm is correct.

Buy Now
Questions 7

Which is one characteristic of an object-oriented language that is not a characteristic of a procedural or functional language?

Options:

A.

The language is optimized for recursive programming.

B.

The language is based on the concept of modular programming and the calling of a subroutine.

C.

The language treats programs as evaluating mathematical functions.

D.

The language supports decomposing a program into objects that interact with one another.

Buy Now
Questions 8

A function determines the least common multiple (LCM) of two positive integers (a and b). What should be the input to the function?

Options:

A.

L only

B.

a * b

C.

a and L

D.

a and b

Buy Now
Questions 9

What is an argument?

Options:

A.

A piece of information provided in a function call

B.

A declared piece of information within a function

C.

A piece of information assigned to a function ' s output

D.

An input named in the definition of a function

Buy Now
Questions 10

Which output results from the following pseudocode?

x = 5

do

x = x + 4

while x < 18

Put x to output

Options:

A.

9

B.

18

C.

21

D.

25

Buy Now
Questions 11

What does a function definition consist of?

Options:

A.

The function ' s argument values

B.

An invocation of a function ' s name

C.

A list of all other functions that call the function

D.

The function ' s name, inputs, outputs, and statements

Buy Now
Questions 12

A software developer determines the mathematical operations that a calculator program should support When two waterfall approach phases are involved?

Options:

A.

Design and Testing

B.

Implementation and testing

C.

Design and implementation

D.

Analysis and design

Buy Now
Questions 13

What is a string?

Options:

A.

A built-in method

B.

A very precise sequence of steps

C.

A sequence of characters

D.

A name that refers to a value

Buy Now
Questions 14

An algorithm should output " OK " if a number is between 98.3 and 98.9, else the output is " Not OK. " Which test is a valid test of the algorithm?

Options:

A.

Input 98.6. Ensure output is " Not OK. "

B.

Input 98.6. Ensure output is " OK. "

C.

Input 99.9. Ensure output is " OK. "

D.

Input 99.9. Ensure output is " 98.9. "

Buy Now
Questions 15

What does a function definition consist of?

Options:

A.

The function’s name, inputs, outputs, and statements

B.

A list of all other functions that call the function

C.

An invocation of a function’s name

D.

The function’s argument values

Buy Now
Questions 16

What is the proper way to declare a student’s grade point average throughout the term if this item is needed in several places in a program?

Options:

A.

Variable float gpa

B.

Constant float gpa

C.

Variable int gpa

D.

Constant int gpa

Buy Now
Questions 17

A sample function is shown:

Scripting-and-Programming-Foundations Question 17

What is returned for F (3)?

Options:

A.

12

B.

4

C.

-20

D.

-5

Buy Now
Questions 18

Which value would require an integer as a data type?

Options:

A.

The cost of a dinner including tax and tip.

B.

An approximation of the number pi to five decimal places.

C.

The weights of every patient involved in a pharmaceutical trial.

D.

The number of students in a section.

Buy Now
Questions 19

A programming loam is using the waterfall design approach to create an application. Which deliverable would be produced during the design phase?

Options:

A.

A report of customer satisfaction

B.

A list of additional features to be added during revision

C.

A written description of the goals for the project

D.

The programming paradigm to be used

Buy Now
Questions 20

A software engineer has written a program that uses a large number of interacting custom data types information hiding, data abstraction encapsulation polymorphism, and inheritance Variables do not need to receive their types ahead of time, and this program can run on a variety of operating systems without having to re-compile the program into machine code.

Which type of language is being used? Choose 3 terms that accurately describe the language.

Options:

A.

Markup

B.

Interpreted

C.

Object-oriented

D.

Procedural

E.

Dynamic

F.

Static

Buy Now
Questions 21

What would a string be used to store?

Options:

A.

A true/false indication of whether a number is composite.

B.

A positive number between 2 and 3.

C.

The word " positive. "

D.

A positive whole number.

Buy Now
Questions 22

Which expression evaluates to 3.7 if float x = 17.0?

Options:

A.

X + 2 / 10

B.

(2 + x) / 10.0

C.

X + 2.0 / 10

D.

2 + x / 10

Buy Now
Questions 23

The steps in an algorithm to build a picnic table are given:

    Measure and mark the lumber cuts that need to be made.

    Buy the needed materials.

    Determine the needed materials.

    Cut the lumber to the proper dimensions.

    Assemble the pieces and paint.Which two steps of the algorithm should be switched to make the algorithm successful?

Options:

A.

1 and 3

B.

1 and 2

C.

2 and 3

D.

2 and 4

Buy Now
Questions 24

What is an advantage of using a programming library?

Options:

A.

There is improved programmer productivity.

B.

Static program elements are visualized.

C.

There are more statements in a user’s main function

D.

Programs need not run to yield results.

Buy Now
Questions 25

A software team has been commissioned to create an animation application. Which event takes place during the analysis phase in the agile approach?

Options:

A.

Sending the application to customers for additional evaluation after new features are added

B.

Deciding to add five new capabilities to the animation application based on customer feedback

C.

Writing the code for five new capabilities

D.

Deciding that new capabilities in the animation application will be written as functions without the needs of any new objects

Buy Now
Questions 26

Which term refers to a function that represents the number of fixed-size memory units used for an input of a given size?

Options:

A.

Space complexity

B.

Linear search

C.

Computational complexity

D.

Runtime

Buy Now
Questions 27

A software team has been commissioned to create an animation application. Which event takes place during the analysis phase in the Agile approach?

Options:

A.

Deciding that new capabilities in the animation application will be written as functions without the need for any new objects

B.

Sending the application to customers for additional evaluation after new features are added

C.

Deciding to add five new capabilities to the animation application based on customer feedback

D.

Writing the code for five new capabilities

Buy Now
Questions 28

A programming team is using the Waterfall design approach to create an application. Which deliverable would be produced during the design phase?

Options:

A.

The programming paradigm to be used

B.

A list of additional features to be added during revision

C.

A report of customer satisfaction

D.

A written description of the goals for the project

Buy Now
Questions 29

What is one characteristic of an object-oriented language that is not a characteristic of a procedural or functional language?

Options:

A.

The language is based on the concept of modular programming and the calling of a subroutine.

B.

The language is optimized for recursive programming.

C.

The language supports decomposing a program into objects that interact with one another.

D.

The language treats programs as evaluating mathematical functions.

Buy Now
Questions 30

Which operation should be used to check if the difference of two values is greater than 1?

Options:

A.

Multiplication

B.

Subtraction

C.

Addition

D.

Division

Buy Now
Questions 31

Which language has extensive support for object-oriented programming?

Options:

A.

Markup

B.

HTML

C.

C

D.

C++

Buy Now
Questions 32

Which phase of a Waterfall approach defines specifics on how to build a program?

Options:

A.

Design

B.

Testing

C.

Analysis

D.

Implementation

Buy Now
Questions 33

Which two situations would be helped by using a programming library?

Options:

A.

A programmer needs to write several interacting objects for a student gradebook application, some of which need an inheritance structure.

B.

A programming student is writing code to iterate through the integers in a list and determine the maximum.

C.

A video game programmer needs to perform several animation tasks, all of which are very common in the industry. The programmer does not want to have to code each task. And they are unsure if they a even know how lo code a few of them.

D.

A programmer needs to perform a series of file compression tasks. These tasks are commonly performed by programmers, and the programmer does not want to have to code them all by hand

E.

A programmer is developing a database application that can house various types of data. The software cannot know ahead of time the data type, and so the programmer needs variables that do not require an initial declaration type.

F.

A programmer is writing a piece of mathematical code that requires the heavy use of recursive functions.

Buy Now
Questions 34

A function should determine the average of x and y.

What should be the function ' s parameters and return value(s)?

Options:

A.

Parameters: x, y. averageReturn value: none

B.

Parameters: averageReturn values: x, y

C.

Parameters: nonsReturn values: x, y

D.

Parameters: x, yReturn value: average

Buy Now
Questions 35

A programmer has been hired to create an inventory system for the books in a library. What is the waterfall phase in which waterfall outlining all the functions that need to be written to support the inventory system?

Options:

A.

Implementation

B.

Testing

C.

Analysis

D.

Design

Buy Now
Questions 36

What is required for all function calls?

Options:

A.

Parameters

B.

Input arguments

C.

Output values

D.

Function name

Buy Now
Questions 37

Which kind of languages are C, C++ and Java?

Options:

A.

Markup

B.

Compiled

C.

Interpreted

D.

Machine code

Buy Now
Questions 38

Which value would require an integer as a data type?

Options:

A.

The number of students in a section

B.

The cost of a dinner including tax and tip

C.

The weights of every patient involved in a pharmaceutical

D.

An approximation of the number pi to five decimal places

Buy Now
Questions 39

What does the following algorithm determine?

Scripting-and-Programming-Foundations Question 39

Options:

A.

Whether x is even

B.

Whether x is evenly divisible by 2 or 3

C.

Whether x is odd

D.

Whether x r > negative. 0, < x positive

Buy Now
Questions 40

A sample function is shown.

Y = -2 ‘’ x - 2

What is returned for f(-1)?

Options:

A.

-3

B.

0

C.

2

D.

6

Buy Now
Questions 41

Which statement describes a compiled language?

Options:

A.

It runs one statement at a time by another program without the need for compilation.

B.

It is considered fairly safe because it forces the programmer to declare all variable types ahead of time and commit to those types during runtime.

C.

It can be run right away without converting the code into an executable file.

D.

It has code that is first converted to an executable file, and then run on a particular type of machine.

Buy Now
Exam Name: WGU Scripting and Programming Foundations Exam
Last Update: Sep 6, 2026
Questions: 138

PDF + Testing Engine

$64.99   $185.69

Testing Engine

$49.99   $142.83

PDF (Q&A)

$54.99   $157.11