Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

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

Questions 4

It is given that integer x = 41 and integer y = 16. What is the value of the expression (x % y)?

Options:

A.

-15

B.

-11

C.

-8

D.

9

Buy Now
Questions 5

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 6

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 7

Which snippet represents the loop condition expression in the given code?

Options:

A.

Integer f = 1

B.

Put f to output

C.

F < 27

D.

F = f + 2

Buy Now
Questions 8

Which kind of language is HTML?

Options:

A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Buy Now
Questions 9

What would a string be used to store?

Options:

A.

A positive whole number

B.

The word "positive"

C.

A true/false indication of whether a number is composite

D.

A positive number between 2 and 3

Buy Now
Questions 10

What does the following algorithm determine?

if x < 0

a = 1

else if x = 0

a = 2

else

a = 3

Options:

A.

Whether x is odd

B.

Whether x is evenly divisible by 2 or 3

C.

Whether x is negative, 0, or positive

D.

Whether x is even

Buy Now
Questions 11

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 12

Which phase of a waterfall approach defines specifies on how to build a program?

Options:

A.

Analysis

B.

Implementation

C.

Design

D.

Testing

Buy Now
Questions 13

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 14

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 15

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 16

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 17

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 18

Consider the given function.

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 19

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 20

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 21

A sequence diagram is shown:

What is the purpose of a sequence diagram?

Options:

A.

It depicts program operations, branches, and loops.

B.

It outlines the needed computations.

C.

It illustrates the communication steps for a particular software scenario.

D.

It outlines the potential actions of a user

Buy Now
Questions 22

Which data type should be used to hold the value of a person's body temperature in Fahrenheit

Options:

A.

Boolean

B.

Integer

C.

String

D.

Float

Buy Now
Questions 23

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

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 24

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 25

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 26

A program calculates the average miles per gallon given miles traveled and gas consumed

How should the item that holds me miles per gallon be declared?

Options:

A.

Constant float milesTraveled

B.

Variable float milesPerGallon

C.

Variable float milesTraveled

D.

Constant float milesPerGallon

Buy Now
Questions 27

What is a characteristic of an interpreted language?

Options:

A.

Generates syntax errors during compilation.

B.

Can be run by a user one statement at a time.

C.

Has a programmer writing machine code.

D.

Is restricted to running on one machine.

Buy Now
Questions 28

A program allows the user to play a game. At the end of each game, the program asks the user if they want to play again.

Which programming structure on its own is appropriate to accomplish this task?

Options:

A.

Nested for loops

B.

One for loop

C.

One while loop

D.

If-else statement

Buy Now
Questions 29

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 30

A function should convert a Fahrenheit temperature (F) to a Celsius temperature. What should be the output from the function?

Options:

A.

C only

B.

F only

C.

F and C

D.

F and 32

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 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 33

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 34

Which operator is helpful in determining if an integer is a multiple of another integer?

Options:

A.

/

B.

||

C.

+

D.

%

Buy Now
Questions 35

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 36

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: x, yReturn value: average

C.

Parameters: noneReturn values: x, y

D.

Parameters: averageReturn values: x, y

Buy Now
Questions 37

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

Options:

A.

variable int gpa

B.

constant float gpa

C.

constant int gpa

D.

variable float gpa

Buy Now
Questions 38

What is an example of an algorithm?

Options:

A.

The list contains apples bananas, and oranges

B.

A webpage uses an HTML file type

C.

The sign of two integers determines the sign of the product

D.

Unplug the device, wait 30 seconds, and restart the device.

Buy Now
Questions 39

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 40

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 41

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

NDE |

Exam Name: WGU Scripting and Programming Foundations Exam
Last Update: May 3, 2025
Questions: 138
Scripting-and-Programming-Foundations pdf

Scripting-and-Programming-Foundations PDF

$25.5  $84.99
Scripting-and-Programming-Foundations Engine

Scripting-and-Programming-Foundations Testing Engine

$30  $99.99
Scripting-and-Programming-Foundations PDF + Engine

Scripting-and-Programming-Foundations PDF + Testing Engine

$40.5  $134.99