Weekend Sale Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

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

Page: 1 / 14
Total 138 questions

WGU Scripting and Programming Foundations Exam Questions and Answers

Question 1

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 2

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

Question # 2

Options:

A.

integer h = 0

B.

h = h +1

C.

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

D.

if userInput == pwd

Question 3

A programmer is writing a simu-lation for a physical experiment. Which phase of the agile approach is being carried writing new procedural code and eliminating certain function calls?

Options:

A.

Testing

B.

Design

C.

Implementation

D.

Analysis

Question 4

What is an accurate way to describe a statically typed language?

Options:

A.

It uses methods that that produce consistent output based upon the arguments passed to those methods.

B.

It includes custom variable types with methods, information hiding, data abstraction, encapsulation, polymorphism, and inheritance.

C.

It is based on the concept of modularization and calling procedures or subroutines.

D.

It requires a large number of variables and variable conversions because of the need to commit to a variable type throughout the life of the program.

Question 5

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 6

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 7

What is required for all function calls?

Options:

A.

Parameters

B.

Input arguments

C.

Output values

D.

Function name

Question 8

A programmer is writing code using C. Which paradigm could the programmer be using?

Options:

A.

A procedural paradigm using dynamic types

B.

A procedural paradigm using sialic types

C.

A functional paradigm using dynamic types

D.

An event-driven paradigm using static types

Question 9

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

Question 10

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

Question # 10

Options:

A.

Backlog

B.

Interview

C.

Return

D.

interviewBacking

Question 11

Which data type should be used to hold the value of a person's body temperature in Fahrenheit

Options:

A.

Boolean

B.

Integer

C.

String

D.

Float

Question 12

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 13

Which kind of languages are C and Java?

Options:

A.

Machine code

B.

Compiled

C.

Interpreted

D.

Markup

Question 14

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 15

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 16

What are two examples of equality operators?

Choose 2 answers.

Options:

A.

-

B.

==

C.

/

D.

not

E.

<=

F.

!=

Question 17

Which value would require an integer as a data type?

Options:

A.

The cost of a dinner including tax and tip.

B.

An approximation of the number pi to five decimal places.

C.

The weights of every patient involved in a pharmaceutical trial.

D.

The number of students in a section.

Question 18

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

Options:

A.

The language is optimized for recursive programming.

B.

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

C.

The language treats programs as evaluating mathematical functions.

D.

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

Question 19

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.

Question 20

The steps in an algorithm to buy a pair of shoes from a store are given in no particular order.

* Bring the shoes to the cashier

* Pay for the shoes

* Enter the store

* Select the pair of shoes

What is the first step of the algorithm?

Options:

A.

Select the pair of shoes.

B.

Bring the shoes to the cashier.

C.

Enter the store

D.

Pay for the shoes.

Question 21

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

Question 22

What is the purpose of an activity diagram, such as the following diagram?

Question # 22

Options:

A.

Describes the execution flow of the PrintPositive activity

B.

Specifics the program’s components that must be present

C.

Visualizes the program's data values

D.

Specifies the program's behavioral requirements

Question 23

One requirement for the language of a protect is that it is based on a series of method calls.

When type of language is characterized in this way?

Options:

A.

Static

B.

Compiled

C.

Functional

D.

Markup

Question 24

Which snippet represents the loop variable update statement in the given code?

integer h = 7

while h < 30

Put h to output

h = h + 2

Options:

A.

h < 30

B.

h = h + 2

C.

Put h to output

D.

integer h = 7

Question 25

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 26

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

NumList = [1, 3, 6, 6, 7, 3]

x = 0

Count = 0

for Number in NumList

x = x + Number

Count = Count + 1

x = x / Count

Put x to output

Options:

A.

5.0

B.

6.0

C.

6.1

D.

8.4

Question 27

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 28

What is the proper way to declare a student’s grade point average throughout the term if this item is needed in several places in a program?

Options:

A.

Variable float gpa

B.

Constant float gpa

C.

Variable int gpa

D.

Constant int gpa

Question 29

Question # 29

What is the output of the given flowchart if the input is 54?

Options:

A.

55

B.

56

C.

58

D.

60

Question 30

A sample function is shown:

Question # 30

What is returned for F (3)?

Options:

A.

12

B.

4

C.

-20

D.

-5

Question 31

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

Question 32

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

Options:

A.

Equality and arithmetic

B.

Assignment and arithmetic

C.

Equality and logical

D.

Logical and arithmetic

Question 33

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 concepts.

B.

It allows variables to change type during execution.

C.

It requires fewer variables and variable conversions than other languages because the types can change during execution.

D.

It does not perform complex algorithms, but instead describes the content and formatting of webpages and other documents.

Question 34

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 35

What is the proper way to declare a student's grade point average throughout the term it this item is needed in several places in a program?

Options:

A.

variable int gpa

B.

constant float gpa

C.

constant int gpa

D.

variable float gpa

Question 36

A sample function is shown.

Y = -2 ‘’ x - 2

What is returned for f(-1)?

Options:

A.

-3

B.

0

C.

2

D.

6

Question 37

A sequence diagram is shown:

Question # 37

What is the purpose of a sequence diagram?

Options:

A.

It depicts program operations, branches, and loops.

B.

It outlines the needed computations.

C.

It illustrates the communication steps for a particular software scenario.

D.

It outlines the potential actions of a user

Question 38

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 39

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 40

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 41

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

Options:

A.

The programming paradigm to be used

B.

A list of additional features to be added during revision

C.

A report of customer satisfaction

D.

A written description of the goals for the project

Page: 1 / 14
Total 138 questions