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

Questions 1

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

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

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

Questions 3

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

Questions 4

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?

Questions 5

Which kind of language is HTML?

Options:
A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Questions 6

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

Questions 7

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.

Questions 8

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.

Questions 9

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.

Questions 10

Consider the given function.

Scripting-and-Programming-Foundations Question 10

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