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

Free and Premium WGU Scripting-and-Programming-Foundations Dumps Questions Answers

WGU Scripting and Programming Foundations Exam Questions and Answers

Question 1

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

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

Question 3

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.

Question 4

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

Question 5

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

Question 6

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

Options:

A.

-15

B.

-11

C.

-8

D.

1

Question 7

Which kind of language is HTML?

Options:

A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Question 8

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

Question 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

Question 10

What does the following algorithm determine?

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,

Question 11

What is an example of an algorithm?

Options:

A.

The sign of two integers determines the sign of the product.

B.

The list contains apples, bananas, and oranges.

C.

A webpage uses an HTML file type.

D.

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

Question 12

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.

Question 13

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

Question 14

A sample function is shown.

Y = -2 ‘’ x - 2

What is returned for f(-1)?

Options:

A.

-3

B.

0

C.

2

D.

6

Question 15

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

Question 16

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

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

Question 17

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

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

Question 19

What is the out of the given pseudocode?

Options:

A.

6

B.

12

C.

15

D.

18

Question 20

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

1) Measure and mark the lumber cuts that need to be made

2) Buy the needed materials

3) Determine the needed materials

4) Cut the lumber to the proper dimensions

5) Assemble the pieces and paint.

Which two steps of the algorithm should be switched to make the algorithm successful?

Options:

A.

2 and 3

B.

1 and 3

C.

2 and 4

D.

1 and 2

Question 21

Review the following sequence diagram:

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

Question 22

Given integer x = 12 and integer y = 4. What is the value of the expression x - y * 2?

Options:

A.

4

B.

6

C.

8

D.

14

Question 23

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

Question 24

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.

Question 25

An example of an behavioral diagram is shown.

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

Question 26

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

Question 27

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

Question 28

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.

Question 29

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

Question 30

What is a characteristic of an interpreted language?

Options:

A.

Is restricted to running on one machine

B.

Generates syntax errors during compilation

C.

Can be run by a user one statement at a time

D.

Has a programmer writing machine code

Question 31

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.

Question 32

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

Question 33

Which kind of languages are C and Java?

Options:

A.

Machine code

B.

Compiled

C.

Interpreted

D.

Markup

Question 34

What is put to output by the following flowchart, if the input is 3.5?

Options:

A.

Backlog

B.

Interview

C.

Return

D.

interviewBacking

Question 35

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.

Question 36

What is output by calling Greeting() twice?

Options:

A.

Hello!

B.

Hello!!

C.

Hello!Hello!

Question 37

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

Options:

A.

Design

B.

Testing

C.

Implementation

D.

Analysis

Question 38

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

Question 39

Which output results from the given algorithm?

Options:

A.

1

B.

5

C.

10

D.

60

Question 40

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

Question 41

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