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

Scripting-and-Programming-Foundations WGU Scripting and Programming Foundations Exam Questions and Answers

Questions 4

The steps in an algorithm to calculate the positive difference in given values, x and y, are given in no particular order:

    Put Diff to output.

    Set Diff = x - y.

    If y > x, set Diff = y - x.

    Declare variable Diff.What is the first step of the algorithm?

Options:

A.

Put Diff to output.

B.

Set Diff = x - y.

C.

If y > x, set Diff = y - x.

D.

Declare variable Diff.

Buy Now
Questions 5

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 6

Which phase of an agile application would create a function that calculates shipping costs based on an item’s weight and delivery zip code?

Options:

A.

Implementation

B.

Analysis

C.

Design

D.

Testing

Buy Now
Questions 7

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 8

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 9

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 10

A software developer creates a list of all objects and functions that will be used in a board game application and then begins to write the code for each object.

Options:

A.

Analysis and implementation

B.

Analysis and design

C.

Design and implementation

D.

Design and testing

Buy Now
Questions 11

Which characteristic distinguishes a markup language from other languages

Options:

A.

It supports decomposing programs into custom types that often combine with other variable types into more complicated concepts.

B.

It does not perform complex algorithms, but instead describes the content and formatting of webpages and other documents.

C.

It allows variables to change type during execution

D.

It requires fewer variables and variable conversions than other languages because the types can change during execution

Buy Now
Questions 12

Consider the given function.

Scripting-and-Programming-Foundations Question 12

What is the total output when F (sign, horse) is called 2 times?

Options:

A.

sign and horse sign and horse

B.

sign and horse sign and horse

C.

sign and horse sign and horse

D.

sign and horse and sign and horse

Buy Now
Questions 13

The steps in an algorithm to buy a pair of shoes from a store are given in no particular order.

* Bring the shoes to the cashier

* Pay for the shoes

* Enter the store

* Select the pair of shoes

What is the first step of the algorithm?

Options:

A.

Select the pair of shoes.

B.

Bring the shoes to the cashier.

C.

Enter the store

D.

Pay for the shoes.

Buy Now
Questions 14

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

Options:

A.

Markup

B.

Compiled

C.

Interpreted

D.

Machine code

Buy Now
Questions 15

Which characteristic distinguishes a markup language from other languages?

Options:

A.

It supports decomposing programs into custom types that often combine with other variable types into more concepts.

B.

It allows variables to change type during execution.

C.

It requires fewer variables and variable conversions than other languages because the types can change during execution.

D.

It does not perform complex algorithms, but instead describes the content and formatting of webpages and other documents.

Buy Now
Questions 16

A software developer determines the mathematical operations that a calculator program should support. Which two Waterfall approach phases are involved?

Options:

A.

Analysis and design

B.

Design and implementation

C.

Implementation and testing

D.

Design and testing

Buy Now
Questions 17

Which expression has a values equal to the rightmost digit of the integer q = 16222?

Options:

A.

Q / 100000

B.

10 % q

C.

Q % 10

D.

Q % 10000````````````````````

Buy Now
Questions 18

Which problem is solved by Dijkstra’s shortest path algorithm?

Options:

A.

Given an increasing array of numbers, is the number 19 in the array?

B.

Given an alphabetized list of race entrants and a person’s name, is the person entered in the race?

C.

Given two newspaper articles, what is the greatest sequence of words shared by both articles?

D.

Given the coordinates of five positions, what is the most fuel-efficient flight path?

Buy Now
Questions 19

Which kind of languages are C and Java?

Options:

A.

Machine code

B.

Compiled

C.

Interpreted

D.

Markup

Buy Now
Questions 20

One requirement for the language of a protect is that it is based on a series of method calls.

When type of language is characterized in this way?

Options:

A.

Static

B.

Compiled

C.

Functional

D.

Markup

Buy Now
Questions 21

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 22

Which expression has a value equal to the rightmost digit of the integer q = 7777?

Options:

A.

10 % q

B.

q % 10

C.

q / 10000

D.

q % 10000

Buy Now
Questions 23

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

Options:

A.

It uses methods that that produce consistent output based upon the arguments passed to those methods.

B.

It includes custom variable types with methods, information hiding, data abstraction, encapsulation, polymorphism, and inheritance.

C.

It is based on the concept of modularization and calling procedures or subroutines.

D.

It requires a large number of variables and variable conversions because of the need to commit to a variable type throughout the life of the program.

Buy Now
Questions 24

One requirement for the language of a project is that it is based on a series of cells. Which type of language is characterized in this way?

Options:

A.

Functional

B.

Static

C.

Markup

D.

Compiled

Buy Now
Questions 25

A particular sorting takes integer list 10,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 only works for 10,6, 8

B.

The algorithm is correct

C.

The algorithm's correctness is unknown

D.

The algorithm is incorrect

Buy Now
Questions 26

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

Options:

A.

Multiple if statements

B.

If statement

C.

While loop

D.

Do-while loop

Buy Now
Questions 27

Which action occurs the design phase of an agile process?

Options:

A.

Wring the required objects

B.

Deciding on the scope of the program

C.

Determining the goals of the project.

D.

Determining the functions that need to be written

Buy Now
Questions 28

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 29

A programming is developing an application that needs to manipulation text in a variety of ways. Everything the programmer needs is standard in the industry and the programmer wants to perform these manipulations with a minimal amount of code. What does the programmer need?

Options:

A.

An algorithm

B.

A function

C.

A script

D.

A programming library

Buy Now
Questions 30

Which action occurs during the design phase of an Agile process?

Options:

A.

Determining the functions that need to be written

B.

Determining the goals of the project

C.

Writing the required objects

D.

Deciding on the name of the program

Buy Now
Questions 31

A team of programmers describes the objects and functions in a program that compresses files before splitting the objects. Which Waterfall approach phases are involved?

Options:

A.

Analysis and implementation

B.

Design and implementation

C.

Implementation and testing

D.

Design and testing

Buy Now
Questions 32

Which characteristic distinguishes an object-oriented language from other languages?

Options:

A.

It includes custom variable types with methods, information hiding, data abstraction, encapsulation, polymorphism, and inheritance.

B.

It is extremely portable and can be run on any machine that has a program than can read the code.

C.

It has variables that never change type during execution

D.

lt specifies a series of well-structured steps to compose a program.

Buy Now
Questions 33

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?

Options:

A.

Implementation

B.

Testing

C.

Design

D.

Analysis

Buy Now
Questions 34

A team of programmers describes the objects and functions in a program that compresses files before splitting the objects.

Which two waterfall approach phases are involved?

Options:

A.

Analysis and implementation

B.

Design and testing

C.

Implementation and testing

D.

Design and implementation

Buy Now
Questions 35

Review the following sequence diagram:

Scripting-and-Programming-Foundations Question 35

What does a sequence diagram do?

Options:

A.

Shows interactions awl indicates an order of events

B.

Shows interactions but does not specify an order of events

C.

Shows sialic elements of software

D.

Shows an order of events but does not specify all interactions

Buy Now
Questions 36

What is the purpose of an activity diagram, such as the following diagram?

Scripting-and-Programming-Foundations Question 36

Options:

A.

Describes the execution flow of the PrintPositive activity

B.

Specifics the program’s components that must be present

C.

Visualizes the program's data values

D.

Specifies the program's behavioral requirements

Buy Now
Questions 37

Which two types of operators are found in the code snippet not (g != S)?

Options:

A.

Equality and arithmetic

B.

Assignment and arithmetic

C.

Equality and logical

D.

Logical and arithmetic

Buy Now
Questions 38

A programmer is writing a simu-lation for a physical experiment. Which phase of the agile approach is being carried writing new procedural code and eliminating certain function calls?

Options:

A.

Testing

B.

Design

C.

Implementation

D.

Analysis

Buy Now
Questions 39

The steps in an algorithm to calculate the positive difference in two given values, x and y, are given in no particular order:

Scripting-and-Programming-Foundations Question 39

What is the first step of the algorithm?

Options:

A.

Set Diff = x - y

B.

Put Diff to output

C.

Deduce variable Diff

D.

If y > x, set Diff = y - x.

Buy Now
Questions 40

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: Apr 28, 2025
Questions: 138

PDF + Testing Engine

$57.75  $164.99

Testing Engine

$43.75  $124.99
buy now Scripting-and-Programming-Foundations testing engine

PDF (Q&A)

$36.75  $104.99
buy now Scripting-and-Programming-Foundations pdf