Winter Special Flat 65% Limited Time Discount offer - Ends in 0d 00h 00m 00s - Coupon code: suredis

WGU Scripting-and-Programming-Foundations WGU Scripting and Programming Foundations Exam Exam Practice Test

WGU Scripting and Programming Foundations Exam Questions and Answers

Question 1

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

Question 2

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

Question 3

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 4

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

Question 5

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.

Question 6

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

Question 7

Which kind of language is HTML?

Options:

A.

Markup

B.

Object-oriented

C.

Statically typed

D.

Dynamically typed

Question 8

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 9

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 10

Given integer x = 12 and integer y = 4

What is the value of the expression x + y12?

Options:

A.

6

B.

8

C.

14

Question 11

A programming is developing an application that needs to manipulation text in a variety of ways. Everything the programmer needs is standard in the industry and the programmer wants to perform these manipulations with a minimal amount of code. What does the programmer need?

Options:

A.

An algorithm

B.

A function

C.

A script

D.

A programming library

Question 12

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 13

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 14

Which output results from the given algorithm?

Options:

A.

1

B.

5

C.

10

D.

60

Question 15

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

Question 16

What is the out of the given pseudocode?

Options:

A.

6

B.

12

C.

15

D.

18

Question 17

Which line is a loop variable update statement in the sample code?

Options:

A.

integer h = 0

B.

h = h +1

C.

(userInput !=pwd) and (h <= 10)

D.

if userInput == pwd

Question 18

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.

Question 19

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.

Question 20

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 21

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

Question 22

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.

Question 23

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 24

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.

Options:

A.

Analysis and implementation

B.

Analysis and design

C.

Design and implementation

D.

Design and testing

Question 25

What is one characteristic of an object-oriented language that is not a characteristic of a procedural or functional language?

Options:

A.

The language is based on the concept of modular programming and the calling of a subroutine.

B.

The language is optimized for recursive programming.

C.

The language supports decomposing a program into objects that interact with one another.

D.

The language treats programs as evaluating mathematical functions.

Question 26

A software developer determines the mathematical operations that a calculator program should support When two waterfall approach phases are involved?

Options:

A.

Design and Testing

B.

Implementation and testing

C.

Design and implementation

D.

Analysis and design