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

Welcome To DumpsPedia

Scripting-and-Programming-Foundations Sample Questions Answers

Questions 4

Which kind of language is HTML?

Options:

A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Buy Now
Questions 5

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 6

What is output by calling Greeting() twice?

Options:

A.

Hello!

B.

Hello!!

C.

Hello!Hello!

Buy Now
Questions 7

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 8

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 9

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 10

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 11

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 12

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 13

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 14

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 15

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 16

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 17

What is required for all function calls?

Options:

A.

Parameters

B.

Input arguments

C.

Output values

D.

Function name

Buy Now
Questions 18

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 19

What is the Agile phase that results in a list of objects to be written?

Options:

A.

Design

B.

Testing

C.

Implementation

D.

Analysis

Buy Now
Questions 20

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 21

Review the following sequence diagram:

21

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 22

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 23

What is the loop variable update statement in the following code?

23

Options:

A.

Put j to output

B.

Integer j = -1

C.

J < 24

D.

J = j + 3

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

Which expression evaluates to 4 if integer y = 3?

Options:

A.

0 - y / 5.0

B.

(1 + y) * 5

C.

11.0 - y / 5

D.

11 + y % 5

Buy Now
Questions 26

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 27

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

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

Options:

A.

Testing

B.

Analysis

C.

Implementation

D.

Design

Buy Now
Questions 29

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

Options:

A.

/

B.

$

C.

| |

D.

+

Buy Now
Questions 30

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 the coordinates of five positions, what is the most fuel-efficient flight pain?

C.

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

D.

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

Buy Now
Questions 31

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 32

Which characteristic specifically describes an object-oriented language?

Options:

A.

Supports creating programs as a set of functions

B.

Requires a compiler to convert to machine code

C.

Can be run on any machine that has an interpreter

D.

Supports creating program as item that have data plus operations

Buy Now
Questions 33

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 34

Oder the tasks needed to safely replace a lamp's light bulb from first (1) to last (4).

Select your answer from the pull down list.

34

Options:

Buy Now
Questions 35

35

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 36

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 37

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

37

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 38

What is one task that could be accomplish using a while loop?

Options:

A.

After inputting two numbers, the program prints out the larger of the two

B.

A user is asked to enter a password repeatedly until either a correct password is entered or five incorrect attempts have been made.

C.

When the user Inputs a number, the program outputs "True" when the number Is a multiple of 10

D.

The user inputs an integer, and the program prints out whether the number is even or odd and whether the number Is positive, negative, or zero.

Buy Now
Questions 39

Which statement describes a compiled language?

Options:

A.

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

B.

It allows variables to change from the initial declared types during program execution.

C.

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

D.

It has code that is first converted to machine code, which can then only run on a particular type of machine.

Buy Now
Questions 40

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 41

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
Exam Code: Scripting-and-Programming-Foundations
Exam Name: WGU Scripting and Programming Foundations Exam
Last Update: Sep 22, 2026
Questions: 138

PDF + Testing Engine

$59.99 $171.4

Testing Engine

$44.99 $128.55

PDF (Q&A)

$49.99 $142.82