Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free WGU Scripting-and-Programming-Foundations Practice Exam with Questions & Answers | Set: 3

Questions 21

What does the following algorithm determine?

Scripting-and-Programming-Foundations Question 21

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,

WGU Scripting-and-Programming-Foundations Premium Access
Questions 22

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

Questions 23

Which two operators can be used for checking divisibility of a number?

Choose 2 answers.

Options:
A.

^

B.

*

C.

+

D.

$

E.

/

F.

%

Questions 24

Given integer x = 12 and integer y = 4

What is the value of the expression x + y12?

Options:
A.

6

B.

8

C.

14

Questions 25

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.

Questions 26

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

Questions 27

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

Questions 28

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

Questions 29

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

Questions 30

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