Month End Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

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

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

Question # 4

A team of programmers describes the objects and functions in a program that compresses files before splitting the objects. Which Waterfall approach phases are involved?

A.

Analysis and implementation

B.

Design and implementation

C.

Implementation and testing

D.

Design and testing

Full Access
Question # 5

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

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

Full Access
Question # 6

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

A.

h < 30

B.

h = h + 2

C.

Put h to output

D.

integer h = 7

Full Access
Question # 7

What is put to output by calling Greeting() twice

A.

Hello!

B.

Hello!Hello!

C.

Hello!

Full Access
Question # 8

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 # 9

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
Question # 10

A function should determine the average of x and y. What should be the function's parameters and return value(s)?

A.

Parameters: x, y, averageReturn value: none

B.

Parameters: x, yReturn value: average

C.

Parameters: noneReturn values: x, y

D.

Parameters: averageReturn values: x, y

Full Access
Question # 11

Which statement describes a compiled language?

A.

It is considered fairly safe because it forces the programmer lo declare all variable types ahead of time and commit to those types during runtime.

B.

It allows variables to change from the initial declared types during program execution.

C.

It specifies a series of well-structured steps to compose a program.

D.

It has code that is first converted to machine code, which can then only run on a particular type of machine.

Full Access
Question # 12

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

A.

-15

B.

-11

C.

-8

D.

1

Full Access
Question # 13

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

A.

Implementation

B.

Analysis

C.

Design

D.

Testing

Full Access
Question # 14

What is a string?

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

Full Access
Question # 15

Oder the tasks needed to safely replace a lamp's light bulb from first (1) to last (4).

Select your answer from the pull down list.

Full Access
Question # 16

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

A.

Design and Testing

B.

Implementation and testing

C.

Design and implementation

D.

Analysis and design

Full Access
Question # 17

A sequence diagram is shown:

What is the purpose of a sequence diagram?

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

Full Access
Question # 18

Which kind of language is HTML?

A.

Dynamically typed

B.

Markup

C.

Statically typed

D.

Object-oriented

Full Access
Question # 19

A function determines the least common multiple (LCM) of two positive integers (a and b). What should be the input to the function?

A.

L only

B.

a * b

C.

a and L

D.

a and b

Full Access
Question # 20

Which kind of languages are C, C++ and Java?

A.

Markup

B.

Compiled

C.

Interpreted

D.

Machine code

Full Access
Question # 21

Which two statements describe advantages to using programming libraries?

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.

Full Access
Question # 22

A sample function is shown:

What is returned for F (3)?

A.

12

B.

4

C.

-20

D.

-5

Full Access
Question # 23

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 # 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 tickets are delivered overnight. Which control structure should be used?

A.

While loop

B.

Do-while loop

C.

If statement

D.

Multiple if statements

Full Access
Question # 25

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 # 26

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

A.

5.0

B.

6.0

C.

6.1

D.

8.4

Full Access
Question # 27

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

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

Full Access
Question # 28

What are two example of valid function calls?

Choose 2 answers.

A.

round_number(4.723, 2)

B.

convort_value(12) returns cVa1

C.

Printsample()

D.

CountFactors(96 integer)

E.

function Sample (float 2.0)

F.

GetHeight(integer 3, integer 4)

Full Access
Question # 29

What are two examples of valid function calls?

Choose 2 answers.

A.

function sample(float 2.0)

B.

GetHeight(integer 3, 4)

C.

round(4.723, 2)

D.

PrintSample()

Full Access
Question # 30

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 # 31

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 # 32

Which characteristic specifically describes an object-oriented language?

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

Full Access
Question # 33

A function should determine the average of x and y.

What should be the function's parameters and return value(s)?

A.

Parameters: x, y. averageReturn value: none

B.

Parameters: averageReturn values: x, y

C.

Parameters: nonsReturn values: x, y

D.

Parameters: x, yReturn value: average

Full Access
Question # 34

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?

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

Full Access
Question # 35

Which characteristic distinguishes an object-oriented language from other languages?

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.

Full Access
Question # 36

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?

A.

An algorithm

B.

A function

C.

A script

D.

A programming library

Full Access
Question # 37

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

A.

Analysis

B.

Implementation

C.

Design

D.

Testing

Full Access
Question # 38

Which phase of a Waterfall approach defines specifics on how to build a program?

A.

Design

B.

Testing

C.

Analysis

D.

Implementation

Full Access
Question # 39

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

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.

Full Access
Question # 40

Given integer x = 12 and integer y = 4

What is the value of the expression x + y12?

A.

6

B.

8

C.

14

Full Access
Question # 41

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

integer h = 0

do

Put "What is the password?" to output

String userInput = Get next input

if userInput != pwd

Put "Incorrect." to output

h = h + 1

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

if userInput = pwd

Put "Access granted." to output

else

Put "Access denied." to output

A.

if userInput = pwd

B.

h = h + 1

C.

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

D.

integer h = 0

Full Access