Month End Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dumps65

WGU Scripting-and-Programming-Foundations Dumps

WGU Scripting and Programming Foundations Exam Questions and Answers

Question 1

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 2

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 3

A program calculates the average miles per gallon given miles traveled and gas consumed. How should the item that holds the miles per gallon be declared?

Options:

A.

Variable float milesTraveled

B.

Constant float milesPerGallon

C.

Constant float milesTraveled

D.

Variable float milesPerGallon

Question 4

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 5

Which three statements describe a characteristic of a programming library?

Options:

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.

Question 6

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?

Options:

A.

Implementation

B.

Testing

C.

Analysis

D.

Design

Question 7

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 8

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

Question 9

Which expression has a values equal to the rightmost digit of the integer q = 16222?

Options:

A.

Q / 100000

B.

10 % q

C.

Q % 10

D.

Q % 10000````````````````````

Question 10

What is a feature of CM as a programming language

Options:

A.

The code must be compiled into machine code in the form of an executable file before execution.

B.

The program usually runs slower than an interpreted language.

C.

The code runs directly one statement at a time by another program called a compiler

D.

The code does not require being translated into machine code but can be run by a separate program called a compiler.

Question 11

Which two statements describe advantages to using programming libraries?

Options:

A.

Using a library minimizes copyright issues in coding

B.

A program that uses libraries is more portable than one that does not.

C.

Using libraries turns procedural code into object-oriented code.

D.

Libraries always make code run faster.

E.

The programmer can improve productivity by using libraries.

F.

Using a library prevents a programmer from having to code common tasks by hand.

Question 12

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. Which two phases of the Agile approach are being carried out?

Options:

A.

Analysis and design

B.

Design and implementation

C.

Analysis and implementation

D.

Design and testing

Question 13

Which output results from the given algorithm?

as

Options:

A.

1

B.

5

C.

10

D.

60

Question 14

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 15

What does a function definition consist of?

Options:

A.

The function's argument values

B.

An invocation of a function's name

C.

A list of all other functions that call the function

D.

The function's name, inputs, outputs, and statements

Question 16

An example of an behavioral diagram is shown.

as

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 17

What does the following algorithm determine?

if x < 0

a = 1

else if x = 0

a = 2

else

a = 3

Options:

A.

Whether x is odd

B.

Whether x is evenly divisible by 2 or 3

C.

Whether x is negative, 0, or positive

D.

Whether x is even

Question 18

Which action occurs during the design phase of an Agile process?

Options:

A.

Determining the functions that need to be written

B.

Determining the goals of the project

C.

Writing the required objects

D.

Deciding on the name of the program

Question 19

A programming loam is using the waterfall design approach to create an application. Which deliverable would be produced during the design phase?

Options:

A.

A report of customer satisfaction

B.

A list of additional features to be added during revision

C.

A written description of the goals for the project

D.

The programming paradigm to be used

Question 20

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 21

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 22

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 23

A program steps through an array and adds up all the numbers stored in the array. What is the appropriate individual control structure that should be used?

Options:

A.

One while loop

B.

Nested for loops

C.

Multiple if statements

D.

One for loop

Question 24

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 25

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

    Put Diff to output.

    Set Diff = x - y.

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

    Declare variable Diff.What is the first step of the algorithm?

Options:

A.

Put Diff to output.

B.

Set Diff = x - y.

C.

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

D.

Declare variable Diff.

Question 26

What is one task that could be accomplished using a while loop?

Options:

A.

When the user inputs a number, the program outputs "True" when the number is a multiple of 10.

B.

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.

C.

After inputting two numbers, the program prints out the larger of the two.

D.

A user is asked to enter a password repeatedly until either a correct password is entered or five attempts have been made.

Question 27

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

Options:

A.

Multiple if statements

B.

If statement

C.

While loop

D.

Do-while loop

Question 28

What is a string?

Options:

A.

A built-in method

B.

A very precise sequence of steps

C.

A sequence of characters

D.

A name that refers to a value

Question 29

Which phase of a waterfall approach defines specifies on how to build a program?

Options:

A.

Analysis

B.

Implementation

C.

Design

D.

Testing

Question 30

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 31

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 32

Which expression has a value equal to the rightmost digit of the integer q = 7777?

Options:

A.

10 % q

B.

q % 10

C.

q / 10000

D.

q % 10000

Question 33

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

as

Options:

A.

Backlog

B.

Interview

C.

Return

D.

interviewBacking

Question 34

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 35

An algorithm should output "OK" if a number is between 98.3 and 98.9, else the output is "Not OK." Which test is a valid test of the algorithm?

Options:

A.

Input 98.6. Ensure output is "Not OK."

B.

Input 98.6. Ensure output is "OK."

C.

Input 99.9. Ensure output is "OK."

D.

Input 99.9. Ensure output is "98.9."

Question 36

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

as

Options:

A.

integer h = 0

B.

h = h +1

C.

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

D.

if userInput == pwd

Question 37

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 38

Which phase of an Agile approach would create a function that calculates shipping costs based on an item’s weight and delivery zip code?

Options:

A.

Testing

B.

Analysis

C.

Implementation

D.

Design

Question 39

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

Options:

A.

-15

B.

-11

C.

-8

D.

9

Question 40

What is the outcome for the given algorithm? Round to the nearest tenth, if necessary.

as

Options:

A.

5.0

B.

6.0

C.

6.1

D.

8.4

Question 41

Which kind of language is HTML?

Options:

A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Page: 1 / 14
Total 138 questions