WGU D278 SCRIPTING AND PROGRAMMING CERTIFICATION SCRIPT 2026 QUESTIONS WITH SOLUTIONS GRAD, Exams of Reasoning

WGU D278 SCRIPTING AND PROGRAMMING CERTIFICATION SCRIPT 2026 QUESTIONS WITH SOLUTIONS GRADED A+

Typology: Exams

2025/2026

Available from 04/03/2026

HighMark_Prep
HighMark_Prep 🇺🇸

5

(3)

27K documents

1 / 22

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
WGU D278 SCRIPTING AND
PROGRAMMING CERTIFICATION SCRIPT
2026 QUESTIONS WITH SOLUTIONS
GRADED A+
What is an advantage of interpreted programs?.
Answer: they can be modified at run time
Function F() Put "Hey" to output What entire output appears after three
successive calls to F()?.
Answer: HeyHeyHey
What does the length property of an array return?.
Answer: The number of elements in the array;
8. In which sections of an HTML document can you embed JavaScript
code?.
Answer: The <head> and/or the <body> sections
16. A JavaScript rule concerning variables states that the first character of a
variable name must be:.
Answer: a letter the underscore character ( _ ) or the dollar sign ( $ ).
Consider the following statement:src="script.js" In programming terms what
is the text "script.js" called?.
Answer: A value or "script.js" is a *string literal or filename*, not just a
generic "value."
What is put to output by the following flowchart, if the input is 17?.
Answer: OK
Which SDLC model emphasizes iterative development and frequent
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download WGU D278 SCRIPTING AND PROGRAMMING CERTIFICATION SCRIPT 2026 QUESTIONS WITH SOLUTIONS GRAD and more Exams Reasoning in PDF only on Docsity!

WGU D278 SCRIPTING AND

PROGRAMMING CERTIFICATION SCRIPT

2026 QUESTIONS WITH SOLUTIONS

GRADED A+

◍ What is an advantage of interpreted programs?. Answer: they can be modified at run time

◍ Function F() Put "Hey" to output What entire output appears after three successive calls to F()?. Answer: HeyHeyHey

◍ What does the length property of an array return?. Answer: The number of elements in the array;

◍ 8. In which sections of an HTML document can you embed JavaScript code?. Answer: The and/or the sections

◍ 16. A JavaScript rule concerning variables states that the first character of a variable name must be:. Answer: a letter the underscore character ( _ ) or the dollar sign ( $ ).

◍ Consider the following statement:src="script.js" In programming terms what is the text "script.js" called?. Answer: A value or "script.js" is a string literal or filename, not just a generic "value."

◍ What is put to output by the following flowchart, if the input is 17?. Answer: OK

◍ Which SDLC model emphasizes iterative development and frequent

customer feedback?. Answer: Agile

◍ What does the slice(1, 3) method return for ["a", "b", "c", "d"]?. Answer: ["b", "c"]

◍ A function returns a number x cubed. For example, if x is 3, the function returns 3 * 3 * 3, or 27. What should be the input to the function?. Answer: x

◍ What is the purpose of the else if clause?,. Answer: To test additional conditions when the initial if is false;

◍ A programmer has developed the following code: count = 0while count is less than 5: print 'Hello' What is the result of implementing this code?. Answer: 'Hello' will print indefinetly

◍ What is the result of the expression "true && false" in JavaScript?. Answer: false

◍ 10. Between which tag pair should you reference an external .js file in your HTML document when you want to add JavaScript from an external text file?. Answer: The tag pair

◍ What does the splice() method do to an array?. Answer: Adds or removes elements at a specific index

◍ What is the purpose of CSS in web development?. Answer: To style and format HTML elements;

◍ What is the correct way to declare an array with three elements?,. Answer: let colors = ["red", "green", "blue"];;

◍ What does the pop() method do to an array?. Answer: Removes the last element from the array;

◍ Which phase of a waterfall approach defines a program's goals?. Answer: analysis

◍ Order the statements needed to output the minimum of x and y from first (1) to last (4). Select your answer from the pull down list.. Answer: declare variable minmin = xif y < min, set min =yput min to output

◍ What is the output of console.log(typeof 42);. Answer: number

◍ Which characteristic specifically describes a markup language?. Answer: tags surround text to describe desired formatting

◍ Which phase of an agile approach would create a list of components needed to build an online auction site?. Answer: design

◍ 31. Consider the following expression: "Good morning " + "Sarah" What type of expression does this code snippet represent?. Answer: String concatenation expression

◍ Which expression represents all the values of x, when x is the age ranging from 18 to 24 years old?. Answer: (x >= 18) and (x <= 24)

◍ 5. Which of the following is the most similar to JavaScript in purpose and implementation?. Answer: JavaScript is more similar to Python or TypeScript in modern use; previously VB Script but that was limited to IE

◍ A programmer shows a program's first version to a customer. The customer provides feedback, which causes the programmer to change the goals of the program. In which phase of an agile approach are goals changed based on customer feedback?. Answer: analysis

◍ 35. The development of HTML5 APIs is expected to intensify as mobile devices continue to multiply. Which technology provides the advanced interactivity required for APIs?. Answer: JavaScript

◍ What does the shift() method do to an array?. Answer: Removes the first element from the array;

◍ What does the keyword var do in JavaScript?. Answer: Declares a variable with function scope;

◍ What is the correct way to represent a decision structure in pseudocode?. Answer: IF condition THEN action;

◍ Which control structure is used to execute different code paths based on multiple conditions?. Answer: switch

◍ What does the following algorithm accomplish?x = Get next inputif x == – Put "Goodbye" to output. Answer: outputs Goodbye when user types -

◍ What is the purpose of braces {} in JavaScript control structures?. Answer: To group multiple statements into a block;

◍ What is the scope of a variable declared with let or const inside a block?. Answer: Block scope;

◍ 25. What is an expression in JavaScript?. Answer: A part of a statement that is evaluated as a value

◍ A programmer wants a compiler to report an error if an integer variable is assigned with a string. Which kind of language should the programmer use?. Answer: statically typed

◍ Which keyword prevents reassignment of a variable?. Answer: const

◍ What does an output of 1 indicate for the following algorithm running on a five-element list of integers?i = 0x = 0while i < 5 if list[i] < 0 x = 1 i = i + 1Put x to output. Answer: at least one integer is negative

◍ What is the correct syntax to call a function named greet?.

Answer: To execute code when the if condition is false;

◍ What is the result of the expression "10" + 5 in JavaScript?. Answer: 105

◍ What does the reverse() method do to an array?,. Answer: Reverses the order of the elements in place;

◍ What is the role of the default case in a switch statement?. Answer: To handle any values not matched by other cases;

◍ What does the indexOf("c") return for ["a", "b", "c", "d"]?. Answer: 2

◍ In a flowchart, what does an arrow indicate?. Answer: The flow of control or sequence

◍ 7. Using JavaScript you create a "ball" object and specify that the ball can be thrown kicked bounced inflated or deflated. What term describes the actions you have specified for your "ball" object?. Answer: Methods

◍ What is the result of the expression 10 % 3 in JavaScript?. Answer: 1

◍ Which data type is used for items that are measured in length?. Answer: float

◍ Which pseudocode keyword is used to define a reusable block of code?. Answer: FUNCTION

◍ What is a valid user-defined function name?. Answer: Any valid identifier

◍ 15. Which JavaScript method should you use if you want to write a message to the user in your Web page as the page loads in the browser?. Answer: The document.write() method

◍ Which keyword is used to define a class in JavaScript (ES6 and later)?. Answer: class

◍ A variable should hold a person's height in meters. Which data type should the variable be?. Answer: float

◍ What is the result of true && false in JavaScript?. Answer: false

◍ In pseudocode, what is the correct syntax for a FOR loop that runs 5 times?. Answer: FOR counter FROM 1 TO 5 DO;

◍ What is the result of this expression in JavaScript "5" + 3?. Answer: "5" + 3?, "53" (string concatenation);

◍ In a nested IF structure, what happens if both conditions are true?. Answer: The inner block executes;

◍ A function should convert hours and minutes to seconds, such as converting 1 hour and 10 minutes to 4,200 seconds. What should be the input to the function?. Answer: hours and minutes

◍ What is the loop variable initialization in the following pseudocode? y = 0s = 100.0while y < 10 s = s + (s * 5.0) y = y + 1. Answer: y=

◍ Who is responsible for gathering requirements during the SDLC?. Answer: Business analyst;

◍ What is the scope of a variable declared with var inside a function?,. Answer: Function scope

◍ Which role typically writes and tests code during the Implementation phase?. Answer: Software developer;

◍ What is the purpose of the console.log() method?. Answer: To output messages to the browser's console for debugging;

◍ What is the correct syntax to create a comment block in JavaScript?.

◍ Which concept in object-oriented programming allows one class to inherit properties from another?. Answer: Inheritance

◍ Which language adds interactivity to a webpage?. Answer: JavaScript

◍ What is the loop expression in the following pseudocode? i = 0while i < 20 Put i to output i = i + 1. Answer: i < 20

◍ Which SDLC phase includes writing the actual code for the software?. Answer: Implementation

◍ What triggers code execution in event-driven programming?. Answer: User actions or system events;

◍ What is the purpose of the Testing phase in the SDLC?. Answer: To identify and fix defects before deployment;

◍ What is the best way to isolate a bug in a program?. Answer: Use print statements to trace variable values;

◍ Which JavaScript keyword is used to declare a variable that can be reassigned?. Answer: let

◍ What is the result of typeof null in JavaScript?. Answer: object

◍ 37. Why should you test your JavaScript code in multiple browsers?. Answer: Because JavaScript programs tend to be implemented differently in different browsers

◍ What does the typeof operator return when applied to an array?. Answer: "object"

◍ 2. What is the main characteristic of a programming language that distinguishes it from a scripting language?.

Answer: Programming languages are traditionally compiled, whereas scripting languages are traditionally interpreted.

◍ Which operator should be used to determine if a number is evenly divisible by 5?. Answer: %

◍ What does the push() method do to an array?,. Answer: Adds an element to the end of the array;

◍ What is the result of parseFloat("10.5") in JavaScript?. Answer: 10.

◍ Which values are considered falsy in JavaScript?. Answer: false, 0, "", null, undefined, NaN

◍ Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events between completed program components?. Answer: design

◍ What is the main benefit of using libraries in programming?. Answer: They provide reusable code to simplify development;

◍ Which text represents an algorithm?. Answer: Shake bulb; if it rattles, replace it.

◍ 32. Which of the following best describes the relationship between JavaScript and Java?. Answer: JavaScript and Java are different languages and have no relationship.

◍ What is an advantage of using a programming library?. Answer: the code has already been tested

◍ 26. In JavaScript how do you combine text strings such as combining the prompt() and alert() methods to request user input and then display it?. Answer: Use concatenation to link two or more text strings.

◍ Which built-in method converts a string to uppercase in JavaScript?. Answer: toUpperCase()

◍ 21. Which JavaScript method should you use if you want to display a message to the user in a popup box when the user opens your Web page?. Answer: The alert() method

◍ What is the result of true || false in JavaScript?. Answer: true

◍ What is a characteristic of a compiled language?. Answer: converts to machine language before running

◍ What does the following pseudocode do?SET total TO 0FOR i FROM 1 TO 5 DOSET total TO total + i,. Answer: Adds the numbers 1 through 5 and stores the result in total

◍ A programmer shows a program's first version to a customer. Based on feedback, the programmer begins writing a second version of the program. In which phase of an agile approach does the writing of a second version of the program occur?. Answer: implementation

◍ Given a start and end location and time traveled in hours, order the statements needed to calculate speed in miles per hour from first (1) to last (4). Select your answers from the pull-down list.. Answer: Declare variables distMiles and speedMphdistMiles = endLocation-startLocationspeedMph = distMiles / timeHoursPut speedMph to output

◍ A function MyFct has an input x and an output z. What does MyFct return?. Answer: z only

◍ 17. Why should you use the JavaScript prompt() method?. Answer: To create a pop-up box with the specified message string and to request user input into a text field in the box

◍ What is the purpose of the return statement in a function?.

Answer: To send a value back to the part of the program that called the function;

◍ What does the splice(1, 2) method do to ["a", "b", "c", "d"]?. Answer: Removes "b" and "c" and returns them;

◍ What is the difference between a parameter and an argument?. Answer: A parameter is a placeholder; an argument is the actual value passed;

◍ What does the !true expression evaluate to?. Answer: false

◍ Given integer x = 3 and integer y = 5. What is the value of the expression (x / 2.0) + y?. Answer: 6.

◍ What does a programmer do first to use an existing programming library?. Answer: include the library

◍ A program determines if a user's age is high enough to run for U. S. president. The minimum age requirement is 35. How should the item that holds the minimum age be declared?. Answer: constant integer minAge

◍ 9. What term is a characteristic of an object that describes the object's attributes?. Answer: Property

◍ Which characteristic specifically describes interpreted languages?. Answer: they can run on any machine having the right interpreter

◍ Which elements are characteristic of a class diagram?. Answer: System's classes, attributes, and methods and their features, constraints, and relationships

◍ What happens if you forget the break statement in a switch case?. Answer: Execution continues into the next case;

Answer: WHILE loop

◍ What is the benefit of writing test cases before coding?,. Answer: Ensures requirements are met and reduces bugs;

◍ Which of the following is a characteristic of event driven programming?. Answer: Loose coupling, responsiveness, user initated actions, inversion of control, event loop, asynchronous processing, event handlers

◍ A programmer is currently programming the fourth version of a program. Each version has additional features to satisfy more customers. In which phase of an agile approach does the programming of the fourth version occur?. Answer: implementation

◍ After a programmer is done writing a program, another person runs the program hundreds of times, each time with different input, checking that each run yields correct output. Which phase of a waterfall approach is the person carrying out?. Answer: testing

◍ 18. Which statement is true regarding capitalization and variable names in JavaScript?. Answer: Variable names can be written in lowercase or uppercase, but it is good coding practice to use consistent capitalization for all names.

◍ Which phase of an agile approach would create an executable program?. Answer: implementation

◍ Which type of error occurs when a program runs but produces incorrect results?. Answer: Logic Error

◍ What does the keyword function define in JavaScript?. Answer: reusable block of code that performs a task;

◍ Which flowchart symbol represents the start or end of a process?. Answer: Oval

◍ Which type of error occurs when a program runs but produces incorrect output?. Answer: Logic error

◍ What is the purpose of a constructor function in object-oriented programming?. Answer: To initialize a new object's properties

◍ A company has a new project it wishes to implement to track and analyze employee and customer interactions. The company leadership determines that the system should support direct data entry as well as automated data capture of phone calls and emails. Which phase of the waterfall process is occurring?. Answer: analysis

◍ 29. Consider the following expression: apartmentNumber = 523 What type of expression does this code snippet represent?. Answer: Assignment

◍ 24. Which variable data type represents a value of "nothing?". Answer: The null data type

◍ A programmer decides a program should convert U. S. units to metric units and decides to write the program in C++ using several functions. Which phase of a waterfall approach is occurring when the programmer starts writing the program?. Answer: implementation

◍ Which debugging technique involves printing variable values to the console?. Answer: Logging

◍ Which type of language is used to define the structure and presentation of web content?. Answer: Markup language

◍ Which language is not built on object-oriented design principles?.

Answer: Application Programming Interface

◍ What is the difference between = and == in JavaScript?. Answer: = assigns a value, == compares values;

◍ In pseudocode, what keyword is typically used to begin a decision structure?,. Answer: IF

◍ 33. Which of the following best describes an object-oriented program?. Answer: A collection of individual objects that perform different functions

◍ Which operator is used to combine two strings in JavaScript?. Answer: +

◍ What is the purpose of a function in programming?. Answer: To group reusable logic into a named block;

◍ 14. What term describes a self-contained programming component that can be used in various situations and in different places in an application?. Answer: Object

◍ A programmer shows a program's first version to a customer. Based on feedback, the programmer creates a second version, and then has a colleague run the second version on numerous inputs to ensure outputs are correct. Which phase of an agile approach is that colleague carrying out?. Answer: testing

◍ What does the expression "5" / 2 return in JavaScript?. Answer: 2.

◍ Which pseudocode keyword is used to begin a loop that repeats a known number of times?. Answer: FOR

◍ What is the result of typeof NaN in JavaScript?. Answer: number

◍ 1. Why is JavaScript relatively easy to learn?.

Answer: Because JavaScript does not have all of the complex rules associated with full object-oriented languages

◍ Which of the following is a compiled language?. Answer: C++

◍ What is a common off-by-one error in loops?. Answer: Loop runs one time too many or too few due to incorrect start/end values;

◍ Which loop structure guarantees that the loop body will execute at least once?. Answer: do...while

◍ A function calculates the weight difference (Diff) given two sample weights (S1 and S2). What should be the output from the function?. Answer: Diff

◍ What is put to output by the following flowchart, if the input is 3 5 -1?. Answer: 6 10

◍ Which language defines the structure of a webpage?. Answer: HTML

◍ Review the following use case diagram: what does a use case diagram do. Answer: Provides an overview of several use cases

◍ 4. JavaScript is a scripting language for adding dynamic interactivity to Web pages. You can use JavaScript to:. Answer: interpret the script and return the appropriate responses on the client side browsers, not servers. that would require Node.js

◍ Order the tasks needed to create a pyramid (large on bottom, small on top) on a table from first (1) to last (4). Select your answer from the pull down list.. Answer: clear tableplace largest shapeplace middle-sized shapeplace smallest shape

◍ Which text represents an algorithm?.