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

Home > WGU > NDE > Scripting-and-Programming-Foundations

Scripting-and-Programming-Foundations WGU Scripting and Programming Foundations Exam Question and Answers

Question # 4

Which expression evaluates to 3.7 if float x = 17.0?

A.

X + 2 / 10

B.

(2 + x) / 10.0

C.

X + 2.0 / 10

D.

2 + x / 10

Full Access
Question # 5

What is a characteristic of an interpreted language?

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

Full Access
Question # 6

Which operation should be used to check if the difference of two values is greater than 1?

A.

Multiplication

B.

Subtraction

C.

Addition

D.

Division

Full Access
Question # 7

Which statement describes a compiled language?

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.

Full Access
Question # 8

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?

A.

Nested for loops

B.

One for loop

C.

One while loop

D.

If-else statement

Full Access
Question # 9

Which three statements describe a characteristic of a programming library?

A.

A library typically must be included before any function in the library is used

B.

A single library normally includes more than one function.

C.

Using libraries will always make a program run less efficiently.

D.

Libraries improve a programmer's productivity.

E.

A single program can only include one library.

F.

One library will contain one function but can have several variables.

Full Access
Question # 10

Which two types of operators are found in the code snippet not (g != S)?

A.

Equality and arithmetic

B.

Assignment and arithmetic

C.

Equality and logical

D.

Logical and arithmetic

Full Access
Question # 11

What does the following algorithm determine?

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,

Full Access
Question # 12

A sample function is shown:

What is returned for F (3)?

A.

12

B.

4

C.

-20

D.

-5

Full Access
Question # 13

Which output results from the following pseudocode?

A.

9

B.

18

C.

21

D.

25

Full Access
Question # 14

A team of programmers describes the objects and functions in a program that compresses files before splitting the objects.

Which two waterfall approach phases are involved?

A.

Analysis and implementation

B.

Design and testing

C.

Implementation and testing

D.

Design and implementation

Full Access
Question # 15

A sample function is shown.

Y = -2 ‘’ x - 2

What is returned for f(-1)?

A.

-3

B.

0

C.

2

D.

6

Full Access
Question # 16

Which term refers to a function that represents the number of fixed-size memory units used for an input of a given size?

A.

Space complexity

B.

Linear search

C.

Computational complexity

D.

Runtime

Full Access
Question # 17

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?

A.

Constant float milesTraveled

B.

Variable float milesPerGallon

C.

Variable float milesTraveled

D.

Constant float milesPerGallon

Full Access
Question # 18

What is an argument?

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

Full Access
Question # 19

A programmer has been hired to create an inventory system for the books in a library. What is the waterfall phase in which waterfall outlining all the functions that need to be written to support the inventory system?

A.

Implementation

B.

Testing

C.

Analysis

D.

Design

Full Access
Question # 20

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

A.

Backlog

B.

Interview

C.

Return

D.

interviewBacking

Full Access
Question # 21

The steps in an algorithm to calculate the positive difference in two given values, x and y, are given in no particular order:

What is the first step of the algorithm?

A.

Set Diff = x - y

B.

Put Diff to output

C.

Deduce variable Diff

D.

If y > x, set Diff = y - x.

Full Access
Question # 22

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

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.

Full Access
Question # 23

Which value would require an integer as a data type?

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

Full Access
Question # 24

A program adds a service fee to the total cost of concert tickets when the tickets are printed and mailed to customers. Another service fee is also added if the

A.

Multiple if statements

B.

If statement

C.

While loop

D.

Do-while loop

Full Access
Question # 25

What is an advantage of using a programming library?

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.

Full Access
Question # 26

A software engineer has written a program that uses a large number of interacting custom data types information hiding, data abstraction encapsulation polymorphism, and inheritance Variables do not need to receive their types ahead of time, and this program can run on a variety of operating systems without having to re-compile the program into machine code.

Which type of language is being used? Choose 3 terms that accurately describe the language.

A.

Markup

B.

Interpreted

C.

Object-oriented

D.

Procedural

E.

Dynamic

F.

Static

Full Access
Question # 27

An example of an behavioral diagram is shown.

What is generally visualized with a behavioral diagram"?

A.

Quality control mechanisms

B.

Relative sizes of program components

C.

Operating system compatibility

D.

The dynamic flow of software

Full Access