Latest WGU Scripting-and-Programming-Foundations PDF and Dumps (2026) Free Exam Questions Answers
Pass Your Courses and Certificates Scripting-and-Programming-Foundations Exam on Mar 18, 2026 with 140 Questions
NEW QUESTION # 80
Which two operators are found in the snippet not (g != 8)?
Choose 2 answers.
- A. Logical and arithmetic
- B. Equality and arithmetic
- C. Assignment and arithmetic
- D. Equality and logical
Answer: D
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
The snippet not (g != 8) contains two operators: not (logical NOT) and != (not equal, an equality operator).
According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), operators are categorized by their function, such as logical, equality, arithmetic, or assignment.
* Snippet Analysis:
* not: A logical operator that negates a boolean expression (e.g., not True yields False).
* !=: An equality operator that checks if two values are not equal (e.g., g != 8 returns True if g is not 8).
* Option A: "Equality and logical." This is correct. The snippet includes != (equality) and not (logical).
* Option B: "Logical and arithmetic." This is incorrect. There are no arithmetic operators (e.g., +, -, *, /) in the snippet.
* Option C: "Equality and arithmetic." This is incorrect. The snippet lacks arithmetic operators.
* Option D: "Assignment and arithmetic." This is incorrect. There are no assignment operators (e.g., =) or arithmetic operators in the snippet.
Certiport Scripting and Programming Foundations Study Guide (Section on Operators).
Python Documentation: "Logical Operators" (https://docs.python.org/3/reference/expressions.html#boolean- operations).
W3Schools: "C Operators" (https://www.w3schools.com/c/c_operators.php).
NEW QUESTION # 81 
cc
What is the output of the given flowchart if the input is 54?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: C
Explanation:
* Start with the input value (in this case, 54).
* Follow the flowchart's paths and apply the operations as indicated by the symbols and connectors.
* The rectangles represent processes or actions to be taken.
* The diamonds represent decision points where you will need to answer yes or no and follow the corresponding path.
* The parallelograms represent inputs/outputs within the flowchart.
* Use the input value and apply the operations as you move through the flowchart from start to finish.
References:
* Flowchart analysis is based on the understanding of flowchart symbols and their meanings, which can be found in resources such as ASQ's guide to flowcharts1 and Asana's explanation of flowchart symbols2.
To determine the correct answer, you would need to apply the input value of 54 to the flowchart and follow the steps until you reach the end, noting the output value. If you encounter any decision points, evaluate the condition with the current value and choose the path accordingly. By the end of the flowchart, you should have the final output value which corresponds to one of the options provided.
NEW QUESTION # 82
Which value would require an integer as a data type?
- A. The cost of a dinner including tax and tip
- B. The number of students in a section
- C. An approximation of the number pi to five decimal places
- D. The weights of every patient involved in a pharmaceutical
Answer: B
Explanation:
An integer data type is used to represent whole numbers without any fractional or decimal component. In the given options:
* A. The number of students in a section is a countable quantity that does not require a fractional part, making it suitable for an integer data type.
* B. The cost of a dinner including tax and tip would typically involve a decimal to account for cents, thus requiring a floating-point data type.
* C. The weights of patients are usually measured with precision and can have decimal values, necessitating a floating-point data type.
* D. An approximation of the number pi to five decimal places is a decimal value and would require a floating-point data type.
References:
* The use of integer data types for countable quantities is a fundamental concept in programming and can be found in introductory programming textbooks such as "Starting Out with Programming Logic and Design" by Tony Gaddis and online resources like the Mozilla Developer Network's (MDN) Web Docs on JavaScript data types.
/**
NEW QUESTION # 83
A programming team is using the Waterfall design approach to create an application. Which deliverable would be produced during the design phase?
- A. A list of additional features to be added during revision
- B. A report of customer satisfaction
- C. The programming paradigm to be used
- D. A written description of the goals for the project
Answer: C
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
The Waterfall methodology is a linear, sequential approach to software development, with distinct phases:
requirements analysis, design, implementation, testing, and maintenance. According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), the design phase in Waterfall produces technical specifications, including architectural decisions like the programming paradigm.
* Waterfall Design Phase:
* Translates requirements into a detailed blueprint for implementation.
* Deliverables include system architecture, data models, programming paradigm (e.g., object- oriented, procedural), and module specifications.
* Option A: "The programming paradigm to be used." This is correct. During the design phase, the team decides on the programming paradigm (e.g., object-oriented for Java, procedural for C) to structure the application, as this guides implementation. This is a key deliverable.
* Option B: "A list of additional features to be added during revision." This is incorrect. Additional features are identified during requirements analysis or later maintenance phases, not design.
* Option C: "A report of customer satisfaction." This is incorrect. Customer satisfaction reports are generated during or after deployment (maintenance phase), not design.
* Option D: "A written description of the goals for the project." This is incorrect. Project goals are defined during the requirements analysis phase, not design.
Certiport Scripting and Programming Foundations Study Guide (Section on Waterfall Methodology).
Sommerville, I., Software Engineering, 10th Edition (Chapter 2: Waterfall Model).
Pressman, R.S., Software Engineering: A Practitioner's Approach, 8th Edition (Waterfall Design Phase).
NEW QUESTION # 84
Which output results from the given algorithm?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: C
Explanation:
The algorithm depicted in the image is a simple loop that iterates 5 times. Each iteration multiplies the current value of i by 2 and adds it to the variable sum. The loop starts with i equal to 1 and sum equal to 0. Here's the breakdown:
* First iteration: i = 1, sum = 0 + (1 * 2) = 2
* Second iteration: i = 2, sum = 2 + (2 * 2) = 6
* Third iteration: i = 3, sum = 6 + (3 * 2) = 12
* Fourth iteration: i = 4, sum = 12 + (4 * 2) = 20
* Fifth iteration: i = 5, sum = 20 + (5 * 2) = 30
However, the algorithm includes a condition that checks if sum is greater than 10. If this condition is true, the algorithm outputs the value of i and stops. This condition is met during the third iteration, where sum becomes
12. Therefore, the algorithm outputs the value of i at that point, which is 3.
References: The explanation is based on the standard behavior of loops and conditional statements in programming. For more information on algorithms and their implementation, you can refer to resources like
"Introduction to Algorithms" by Cormen et al. and online platforms like GeeksforGeeks1.
NEW QUESTION # 85
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?
- A. Implementation
- B. Design
- C. Testing
- D. Analysis
Answer: B
Explanation:
In the Waterfall model of software development, the phase where all functions that need to be written to support the inventory system would be outlined is the Design phase. This phase is critical as it translates the requirements gathered during the analysis phase into a blueprint for constructing the system. It involves two subphases: logical design and physical design. The logical design subphase is where possible solutions are brainstormed and theorized, while the physical design subphase is when those theoretical ideas and schemas are turned into concrete specifications12.
NEW QUESTION # 86
Which term refers to a function that represents the number of fixed-size memory units used for an input of a given size?
- A. Linear search
- B. Computational complexity
- C. Space complexity
- D. Runtime
Answer: C
Explanation:
Space complexity refers to the amount of memory space required by an algorithm in relation to the size of the input data. It is a function, often denoted as S(N), that represents the number of fixed-size memory units used by the algorithm for an input of size N. For example, if an algorithm needs to create a new array that is the same size as the input array, its space complexity would be linear, or O(N), where N is the size of the input array. This term is crucial in evaluating the efficiency of an algorithm, especially when working with large data sets or in systems with limited memory resources.
NEW QUESTION # 87
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. Design
- B. Testing
- C. Analysis
- D. Implementation
Answer: D
Explanation:
In the Agile software development life cycle, the Implementation phase is where the actual coding and development of the project take place. This is the stage where a function to calculate shipping costs based on an item's weight and delivery zip code would be created. The Implementation phase involves translating the design and analysis work into functional software components. It's during this phase that developers write code and build features that will eventually be tested and refined in subsequent phases.
References:
* Agile methodologies emphasize incremental development and delivery, where the Implementation phase is key for developing new functions1.
* The Agile Software Development Life Cycle outlines the Implementation phase as the stage where the actual product development happens2.
* Wrike's Agile Guide also describes the Implementation (or Iteration) phase as the time when the team builds the software3.
NEW QUESTION # 88
A programmer is writing code using C. Which paradigm could the programmer be using?
- A. An event-driven paradigm using static types
- B. A procedural paradigm using dynamic types
- C. A procedural paradigm using sialic types
- D. A functional paradigm using dynamic types
Answer: C
Explanation:
C is a programming language that primarily follows the procedural programming paradigm1. This paradigm is a subset of imperative programming and emphasizes on procedure in terms of the underlying machine model1. It involves writing a sequence of instructions to tell the computer what to do step by step, and it relies on the concept of procedure calls, where procedures, also known as routines, subroutines, or functions, are a set of instructions that perform a specific task1.
The procedural paradigm in C uses static typing, where the type of a variable is known at compile time1. This means that the type of a variable is declared and does not change over time, which is in contrast to dynamic typing, where the type can change at runtime. C's type system requires that each variable and function is explicitly declared with a type and it does not support dynamic typing as seen in languages like Python or JavaScript1.
References: 1: Introduction of Programming Paradigms - GeeksforGeeks
NEW QUESTION # 89
What is put to output by the following flowchart, if the input is 305?
- A. Return
- B. Interview
- C. Backlog
- D. interviewBacking
Answer: B
Explanation:
The flowchart provided in the image represents a decision-making process based on the input value. Given the input of 305, we follow the flowchart's decision paths. The first decision checks if the input is less than 200, which 305 is not, so we move to the next decision point. The second decision asks if the input is greater than
300. Since 305 is greater than 300, we follow the path for 'yes' which leads us to the output "Interview".
Therefore, the correct output for the input 305 according to the flowchart is "Interview".
References:
* Understanding flowchart symbols and their usage in representing decision-making processes1.
* Analyzing flowcharts to determine the output based on given input values2.
* General principles of flowchart design and interpretation3.
NEW QUESTION # 90
Which kind of language is HTML?
- A. Object-oriented
- B. Statically typed
- C. Dynamically typed
- D. Markup
Answer: D
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
HTML (HyperText Markup Language) is a standard for structuring content on the web. According to foundational programming principles, HTML is a markup language, not a programming language, and does not involve typing (dynamic or static) or OOP.
* Option A: "Dynamically typed." This is incorrect. HTML is not a programming language and does not involve variables or typing. Dynamic typing applies to languages like Python or JavaScript.
* Option B: "Markup." This is correct. HTML is a markup language used to define the structure of web content using tags (e.g., <p>, <div>).
* Option C: "Statically typed." This is incorrect. HTML does not involve typing, as it is not a programming language. Static typing applies to languages like C or Java.
* Option D: "Object-oriented." This is incorrect. HTML lacks OOP features like classes, inheritance, or polymorphism, as it is designed for content structuring, not programming.
Certiport Scripting and Programming Foundations Study Guide (Section on Markup Languages).
W3Schools: "HTML Introduction" (https://www.w3schools.com/html/html_intro.asp).
Mozilla Developer Network: "HTML Basics" (https://developer.mozilla.org/en-US/docs/Learn
/Getting_started_with_the_web/HTML_basics).
NEW QUESTION # 91
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. Multiple if statements
- B. If statement
- C. While loop
- D. Do-while loop
Answer: A
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
The program applies service fees based on two independent conditions: (1) if tickets are printed and mailed, and (2) if tickets are delivered overnight. According to foundational programming principles, multiple independent conditions are best handled by separate if statements, as each fee is applied conditionally and does not require iteration.
* Option A: "While loop." This is incorrect. A while loop is used for repeated execution, but applying fees is a one-time decision per ticket order, not a repetitive task.
* Option B: "Do-while loop." This is incorrect. A do-while loop guarantees at least one iteration, which is unnecessary here, as the fee application is a single check.
* Option C: "If statement." This is incorrect. A single if statement can handle one condition, but two independent conditions (mailed and overnight) require separate checks.
* Option D: "Multiple if statements." This is correct. Two if statements can independently check each condition and add the corresponding fee. For example, in Python:
total = ticket_cost
if mailed:
total += mail_fee
if overnight:
total += overnight_fee
Certiport Scripting and Programming Foundations Study Guide (Section on Control Structures: Conditionals).
Python Documentation: "If Statements" (https://docs.python.org/3/tutorial/controlflow.html#if-statements).
W3Schools: "C If Statement" (https://www.w3schools.com/c/c_if_else.php).
NEW QUESTION # 92
Consider the given flowchart.
What is the output of the input is 7?
- A. Within 2
- B. Equal
- C. Within 5
- D. Not close
Answer: D
Explanation:
* Start with the input value (in this case, 7).
* Follow the flowchart's paths and apply the operations as indicated by the symbols and connectors.
* The rectangles represent processes or actions to be taken.
* The diamonds represent decision points where you will need to answer yes or no and follow the corresponding path.
* The parallelograms represent inputs/outputs within the flowchart.
* Use the input value and apply the operations as you move through the flowchart from start to finish.
References:
* Flowchart analysis is based on the understanding of flowchart symbols and their meanings, which can be found in resources such as ASQ's guide to flowcharts1 and Asana's explanation of flowchart symbols2.
To determine the correct answer, you would need to apply the input value of 7 to the flowchart and follow the steps until you reach the end, noting the output value. If you encounter any decision points, evaluate the condition with the current value and choose the path accordingly. By the end of the flowchart, you should have the final output value which corresponds to one of the options provided.
I hope this helps you in analyzing the flowchart and finding the correct output! If you have any more questions or need further assistance, feel free to ask.
NEW QUESTION # 93
A function determines the least common multiple (LCM) of two positive integers (a and b). What should be the input to the function?
- A. a and L
- B. a and b
- C. L only
- D. a * b
Answer: B
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
The least common multiple (LCM) of two positive integers a and b is the smallest number that is a multiple of both. A function to compute the LCM requires a and b as inputs to perform the calculation (e.g., using the formula LCM(a, b) = (a * b) / GCD(a, b), where GCD is the greatest common divisor). According to foundational programming principles, the function's inputs must include all values needed to compute the output.
* Task Analysis:
* Goal: Compute LCM of a and b.
* Required inputs: The two integers a and b.
* Output: The LCM (denoted as L in the question).
* Option A: "L only." This is incorrect. L is the output (the LCM), not an input. The function needs a and b to calculate L.
* Option B: "a * b." This is incorrect. The product a * b is used in the LCM formula (LCM = (a * b) / GCD(a, b)), but the function needs a and b separately to compute the GCD and then the LCM.
* Option C: "a and L." This is incorrect. L is the output, not an input, and the function does not need L to compute itself.
* Option D: "a and b." This is correct. The function requires the two integers a and b as inputs to compute their LCM. For example, in Python:
def lcm(a, b):
def gcd(x, y):
while y:
x, y = y, x % y
return x
return (a * b) // gcd(a, b)
Certiport Scripting and Programming Foundations Study Guide (Section on Functions and Parameters).
Cormen, T.H., et al., Introduction to Algorithms, 3rd Edition (Chapter 31: Number-Theoretic Algorithms).
GeeksforGeeks: "LCM of Two Numbers" (https://www.geeksforgeeks.org/lcm-of-two-numbers/).
NEW QUESTION # 94
What would a string be used to store?
- A. A positive number between 2 and 3
- B. The word "positive"
- C. A positive whole number
- D. A true/false indication of whether a number is composite
Answer: B
Explanation:
In programming, a string is used to store sequences of characters, which can include letters, numbers, symbols, and spaces. Strings are typically utilized to store textual data, such as words and sentences12. For example, the word "positive" would be stored as a string. While strings can contain numbers, they are not used to store numbers in their numeric form but rather as text. Therefore, options A, C, and D, which involve numbers or boolean values, would not be stored as strings unless they are meant to be treated as text.
References: 1: Coderslang: Become a Software Engineer - What is a String in Programming. 2: Wikipedia - String (computer science).
NEW QUESTION # 95
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?
- A. Analysis and design
- B. Analysis and implementation
- C. Design and implementation
- D. Design and testing
Answer: C
Explanation:
Comprehensive and Detailed Explanation From Exact Extract:
The tasks described involve creating a technical plan (listing objects and functions) and coding (writing the objects). According to foundational programming principles and Agile methodologies, these correspond to the design phase (planning the structure) and the implementation phase (coding).
* Agile Phases Analysis:
* Analysis: Defines requirements (e.g., "the game must support players and moves").
* Design: Specifies technical components (e.g., objects like Player, Board, and functions like makeMove()).
* Implementation: Writes the code for the specified components.
* Testing: Verifies the code works as intended.
* Tasks Breakdown:
* Creating a list of objects and functions: This is a design task, as it involves planning the program' s structure (e.g., class diagrams or function signatures).
* Writing the code for each object: This is an implementation task, as it involves coding the objects (e.g., implementing the Player class).
* Option A: "Analysis and design." This is incorrect. Analysis defines high-level requirements, not the specific objects and functions, which are part of design.
* Option B: "Design and implementation." This is correct. Designing the list of objects and functions occurs in the design phase, and writing their code occurs in the implementation phase.
* Option C: "Analysis and implementation." This is incorrect. Analysis does not involve listing technical components like objects and functions.
* Option D: "Design and testing." This is incorrect. Testing verifies the coded objects, not the act of creating their list or writing their code.
Certiport Scripting and Programming Foundations Study Guide (Section on Agile Phases).
Sommerville, I., Software Engineering, 10th Edition (Chapter 4: Agile Software Development).
Agile Alliance: "Design and Implementation" (https://www.agilealliance.org/glossary/design/).
NEW QUESTION # 96
......
Scripting-and-Programming-Foundations Dumps for Courses and Certificates Certified Exam Questions and Answer: https://pass4sure.testvalid.com/Scripting-and-Programming-Foundations-valid-exam-test.html