WGU Scripting and Programming Foundations Exam Questions

Page: 1 / 14
Total 138 questions
Question 1

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



Answer : C

Comprehensive and Detailed Explanation From Exact Extract:

The Waterfall methodology follows a linear sequence: requirements analysis, design, implementation, testing, and maintenance. According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), the design phase involves creating detailed technical specifications, including outlining functions to be written.

Waterfall Phases Overview:

Analysis: Defines requirements (e.g., ''the system must track books, loans, and returns'').

Design: Creates technical plans, including system architecture and function specifications (e.g., addBook(), checkOutBook()).

Implementation: Writes the code for the specified functions.

Testing: Verifies the system meets requirements.

Option A: 'Testing.' This is incorrect. Testing verifies the implemented functions, not their planning.

Option B: 'Analysis.' This is incorrect. Analysis identifies high-level requirements (e.g., system features), not specific functions.

Option C: 'Design.' This is correct. In the design phase, the programmer outlines the functions needed (e.g., function names, parameters, and purposes) to support the inventory system, creating a blueprint for implementation.

Option D: 'Implementation.' This is incorrect. Implementation involves coding the functions, which occurs after they are outlined in the design phase.

Certiport Scripting and Programming Foundations Study Guide (Section on Waterfall Methodology).

Pressman, R.S., Software Engineering: A Practitioner's Approach, 8th Edition (Chapter 2: Waterfall Model).

Sommerville, I., Software Engineering, 10th Edition (Chapter 2: Waterfall Design).


Question 2

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.



Answer : C

The process described involves two main phases: first, the developer is designing the application by creating a list of all objects and functions (the design phase), and then they are writing the code for each object (the implementation phase). This aligns with option C, Design and Implementation. Analysis would involve understanding the requirements or problems the software will address, which is not mentioned in the scenario. Testing is a separate phase that typically occurs after implementation to ensure the code works as intended.


Question 3

Review the following sequence diagram:

What does a sequence diagram do?



Answer : A

A sequence diagram is a type of interaction diagram used in software engineering to model the interactions between objects within a system over time. It shows how objects interact with each other and the order in which those interactions occur. The sequence diagram is organized along two dimensions: horizontally to represent the objects involved, and vertically to represent the time sequence of interactions.This allows the diagram to depict not only the interactions but also the sequence of events as they occur over time12345.

Option B is incorrect because a sequence diagram does indeed specify an order of events. Option C is incorrect as sequence diagrams do not show static elements of software but rather the dynamic interactions. Option D is also incorrect because a sequence diagram does show all interactions along with their order.


Question 4

What does the following algorithm determine?



Answer : C

The algorithm provided in the image performs a modulo operation with 2 (x % 2) and checks if the result is 1. In programming, the modulo operation gives the remainder of the division of two numbers. For any integerx, ifx % 2equals 1, it means thatxis odd because it has a remainder of 1 when divided by 2. Even numbers, when divided by 2, have no remainder and thus would return 0 in a modulo 2 operation.


Question 5

An algorithm should output ''OK'' if a number is between 98.3 and 98.9, else the output is ''Net OK''

Which test is a valid test of the algorithm?



Answer : B

The algorithm is designed to output ''OK'' if the input number is within the range of 98.3 to 98.9. Therefore, the valid test would be one that checks if the algorithm correctly identifies a number within this range and outputs ''OK''. Option B provides an input of 98.6, which falls within the specified range, and expects the correct output of ''OK'', making it a valid test case for the algorithm.


1: Stack Overflow - How to decide test cases for unit tests?2: Analytics Vidhya - Writing Test Cases for Machine Learning systems3: LinkedIn - How to Choose the Best Test Cases for Your Algorithm

Question 6

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



Answer : B

C, C++, and Java are all considered compiled languages. This means that the code written in these languages is not executed directly by the hardware but must first be translated into machine code by a compiler.

Cis a general-purpose programming language that is compiled to generate machine code which can be executed directly by the computer's CPU1.

C++is an extension of C that includes object-oriented features.It is also a compiled language, where the source code is converted into machine code that can be executed by the CPU2.

Javais a bit unique because it is compiled into bytecode, which is then run on a virtual machine (JVM) rather than directly by the CPU.However, it is still considered a compiled language because the source code is compiled before it is executed2.


Understanding of the compilation process for C, C++, and Java.

Official documentation and language specifications for C, C++, and Java.

Articles and resources on programming language paradigms and compiler design.

Question 7

An example of an behavioral diagram is shown.

What is generally visualized with a behavioral diagram"?



Answer : D

Behavioral diagrams are a key component in software engineering, particularly within the Unified Modeling Language (UML), which is used to model the dynamic aspects of systems. These diagrams help visualize the behavior of a system over time, including how it responds to various stimuli and the state changes it undergoes during its operation.

The types of behavioral diagrams include:

State Machine Diagrams:These show the state of a system or component at finite instances of time, focusing on state transitions in response to events.

Activity Diagrams:These illustrate the flow of control in a system, modeling both sequential and concurrent activities.

Use Case Diagrams:These depict the functionality of a system and its interaction with external agents.

Sequence Diagrams:These detail the interactions between objects in a sequential order, showing the order of operations.

Communication Diagrams:These show the sequenced messages exchanged between objects.

In the context of the provided image, a behavioral diagram would generally be used to visualize option D, the dynamic flow of software, as it captures the interactions, events, and states that occur within a system during its execution12345.


GeeksforGeeks provides a comprehensive overview of behavioral diagrams in UML1.

Additional insights into behavioral models and their applications can be found in resources like Sparx Systems' Enterprise Architect User Guide3and other educational platforms245.

Page:    1 / 14   
Total 138 questions