Month End Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: best70

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

Questions 4

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. Which two phases of the Agile approach are being carried out?

Options:

A.

Analysis and design

B.

Design and implementation

C.

Analysis and implementation

D.

Design and testing

Buy Now
Questions 5

An example of an behavioral diagram is shown.

Scripting-and-Programming-Foundations Question 5

What is generally visualized with a behavioral diagram"?

Options:

A.

Quality control mechanisms

B.

Relative sizes of program components

C.

Operating system compatibility

D.

The dynamic flow of software

Buy Now
Questions 6

A programmer is writing code using C. Which paradigm could the programmer be using?

Options:

A.

A procedural paradigm using dynamic types

B.

A procedural paradigm using sialic types

C.

A functional paradigm using dynamic types

D.

An event-driven paradigm using static types

Buy Now
Questions 7

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

Options:

A.

Integer

B.

String

C.

Float

D.

Boolean

Buy Now
Questions 8

Which language has extensive support for object-oriented programming?

Options:

A.

Markup

B.

HTML

C.

C

D.

C++

Buy Now
Questions 9

Scripting-and-Programming-Foundations Question 9

What is the output of the given flowchart if the input is 54?

Options:

A.

55

B.

56

C.

58

D.

60

Buy Now
Questions 10

An algorithm should output ‘’OK’’ if a number is between 98.3 and 98.9, else the output is ‘’Net OK’’

Which test is a valid test of the algorithm?

Options:

A.

Input 99.9. Ensure output is M98 9 "

B.

Input 98.6. Ensure output is "OK "

C.

Input 99.9. Ensure output is "OK"

D.

Input 98.6. Ensure output is "Not OK ‘’

Buy Now
Questions 11

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 12

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 13

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 14

Which two statement describe advantages to using programming libraries? Choose 2 answers

Options:

A.

Using libraries turns procedural code into object-oriented code.

B.

Using a library prevents a programmer from having to code common tasks by hand

C.

A program that uses libraries is more portable than one that does not

D.

Libraries always make code run faster.

E.

The programmer can improve productivity by using libraries.

F.

Using a library minimizes copyright issues in coding.

Buy Now
Questions 15

What is the outcome for the given algorithm? Round to the nearest tenth, if necessary.

NumList = [1, 3, 6, 6, 7, 3]

x = 0

Count = 0

for Number in NumList

x = x + Number

Count = Count + 1

x = x / Count

Put x to output

Options:

A.

5.0

B.

6.0

C.

6.1

D.

8.4

Buy Now
Questions 16

Which type of language requires variables to be declared ahead of time and prohibits their types from changing while the program runs?

Options:

A.

Scripted (interpreted)

B.

Procedural

C.

Static

D.

Compiled

Buy Now
Questions 17

A sequence diagram is shown:

Scripting-and-Programming-Foundations Question 17

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 18

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

Options:

A.

/

B.

$

C.

| |

D.

+

Buy Now
Questions 19

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 20

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 21

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 22

A programmer receives requirements from customers and deciders 1o build a first version of a program.

Which phase of an agile approach is being carried out when trio programmer starts writing the program's first version?

Options:

A.

Testing

B.

Implementation

C.

Analysis

D.

Design

Buy Now
Questions 23

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 24

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 25

Which expression evaluates to 14 if integer y = 13?

Options:

A.

11 + y % 5

B.

11 - y / 5.0

C.

(11 + y) % 5

D.

11.0 - y / 5

Buy Now
Questions 26

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 27

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

Which characteristic specifically describes an object-oriented language?

Options:

A.

Supports creating programs as items that have data plus operations.

B.

Supports creating programs as a set of functions.

C.

Requires a compiler to translate to machine code.

D.

Can be run on any machine that has an interpreter.

Buy Now
Questions 30

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 31

Which output results from the given algorithm?

Scripting-and-Programming-Foundations Question 31

Options:

A.

1

B.

5

C.

10

D.

60

Buy Now
Questions 32

Consider the given function:

function K(string s1, string s2)

Put s1 to output

Put " and " to output

Put s2 to output

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

Options:

A.

sign and horse and sign and horse

B.

sign and horsesign and horse

C.

sign and horse

D.

sign and horse

E.

sign and horse sign and horse

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

An algorithm to calculate the positive difference in two given values, x and y, uses the steps shown.

Scripting-and-Programming-Foundations Question 34

What are the two steps of the algorithm that need to be switched to result in success?

Options:

A.

1 and 2

B.

2 and 4

C.

1 and 4

D.

3 and 4

Buy Now
Questions 35

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 36

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 37

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 38

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 38

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 39

Which two operators are found in the snippet not (g != 8)?

Choose 2 answers.

Options:

A.

Equality and logical

B.

Logical and arithmetic

C.

Equality and arithmetic

D.

Assignment and arithmetic

Buy Now
Questions 40

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

Options:

A.

Markup

B.

Compiled

C.

Interpreted

D.

Machine code

Buy Now
Questions 41

What is a feature of a compiled programming language?

Options:

A.

The program usually runs slower than an interpreted language.

B.

The code runs directly one statement at a time by another program called a compiler.

C.

The code must be compiled into machine code in the form of an executable file before execution.

D.

The code does not require being translated into machine code but can be run by a separate program called a compiler.

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

PDF + Testing Engine

$134.99

Testing Engine

$99.99

PDF (Q&A)

$84.99