시험덤프
매달, 우리는 1000명 이상의 사람들이 시험 준비를 잘하고 시험을 잘 통과할 수 있도록 도와줍니다.
  / Scripting and Programming Foundations 덤프  / Scripting and Programming Foundations 문제 연습

WGU Scripting and Programming Foundations 시험

WGU Scripting and Programming Foundations Exam 온라인 연습

최종 업데이트 시간: 2025년06월06일

당신은 온라인 연습 문제를 통해 WGU Scripting and Programming Foundations 시험지식에 대해 자신이 어떻게 알고 있는지 파악한 후 시험 참가 신청 여부를 결정할 수 있다.

시험을 100% 합격하고 시험 준비 시간을 35% 절약하기를 바라며 Scripting and Programming Foundations 덤프 (최신 실제 시험 문제)를 사용 선택하여 현재 최신 90개의 시험 문제와 답을 포함하십시오.

 / 4

Question No : 1


What are two example of valid function calls?
Choose 2 answers.

정답:
Explanation:
A. round_number(4.723, 2) - This is not a valid function call because there is no function named round_number defined in the given context.
B. convort_value(12) - This is not a valid function call either. Additionally, the expected return value “cVa1” seems to be a typo or an incorrect value.
C. Printsample() - This is a valid function call. It invokes the function named Printsample.
D. CountFactors(96 integer) - This is not a valid function call. The parameter “integer” should not be included in the function call.
E. function Sample(float 2.0) - This is not a valid function call. The function name should not start with the keyword “function,” and the parameter “float 2.0” is not correctly formatted.
F. GetHeight(integer 3, integer 4) - This is a valid function call. It calls the function GetHeight with two integer arguments: 3 and 4.
References
GeeksforGeeks: Function Calling in Programming
Stack Overflow: Different ways to call a function

Question No : 2


A program calculates the average miles per gallon given miles traveled and gas consumed.
How should the item that holds the miles per gallon be declared?

정답:
Explanation:
From Exact Extract:
Miles per gallon (MPG) is calculated as miles traveled divided by gallons consumed, typically resulting in a decimal value (e.g., 25.5 MPG). According to foundational programming principles, MPG should be a variable (as it is computed and may change) and a floating-point type to handle decimals.
Option A: "Variable float milesTraveled." This is incorrect. While miles traveled may be a float variable, the question asks for the declaration of MPG, not miles traveled.
Option B: "Constant float milesPerGallon." This is incorrect. MPG is calculated and may vary with different inputs, so it should be a variable, not a constant (const).
Option C: "Constant float milesTraveled." This is incorrect. The question focuses on MPG, not miles traveled, and constants are inappropriate for computed values.
Option D: "Variable float milesPerGallon." This is correct. MPG requires a float to store decimal values
(e.g., 22.7) and a variable to allow updates based on new calculations. For example, in C: float milesPerGallon = miles / gallons;.
Certiport Scripting and Programming Foundations Study Guide (Section on Variables and Data Types).
Python Documentation: “Floating Point Arithmetic” (https://docs.python.org/3/tutorial/floatingpoint.html).
W3Schools: “C Data Types” (https://www.w3schools.com/c/c_data_types.php).

Question No : 3


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

정답:
Explanation:
The Waterfall Model is a sequential design process used in software development, where progress is seen as flowing steadily downwards through several phases like a waterfall. In the context of the question, describing the objects and functions in a program that compresses files before splitting the objects involves two specific phases:
Design Phase: This is where the system’s architecture, components, interfaces, and data are all defined. The team would design the objects and functions necessary for the file compression program during this phase.
Implementation (or Development) Phase: Following the design, the actual code is written during the implementation phase. The objects and functions described in the design phase are created and tested to ensure they work as intended.
These two phases are critical in the Waterfall approach for transitioning from an abstract understanding of the problem to a concrete implementation in code. The analysis phase is more about understanding the problem and requirements, while testing is a separate phase that comes after implementation.

Question No : 4


What is an advantage of using a programming library?

정답:
Explanation:
Programming libraries are collections of pre-written code that developers can use to optimize tasks and solve common problems efficiently. By using a library, developers don’t have to write everything from scratch, which saves time and reduces the potential for errors. Libraries can provide solutions for user authentication, data visualization, animations, networking, and more, allowing developers to focus on the unique aspects of their projects rather than reinventing the wheel123.

Question No : 5


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?

정답:
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).

Question No : 6


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.

정답:
Explanation:
The language described in the question exhibits characteristics of an interpreted, object-oriented, and dynamic language.
Here’s why these terms apply:
Interpreted: The program can run on various operating systems without re-compilation, which is a trait of interpreted languages. Interpreted languages are executed line by line by an interpreter at runtime, rather than being compiled into machine code beforehand123.
Object-oriented: The use of concepts like information hiding, data abstraction, encapsulation, polymorphism, and inheritance are hallmarks of object-oriented programming (OOP). OOP languages are designed around objects and classes, which allow for modular, reusable, and organized code456.
Dynamic: Variables in the program do not need to have their types declared ahead of time, indicating dynamic typing. In dynamically typed languages, type checking is performed at runtime, and variables can be assigned to different types of data over their lifetime7891011.

Question No : 7


What does the following algorithm determine?
if x < 0
a = 1
else if x = 0
a = 2
else
a = 3

정답:
Explanation:
From Exact Extract:
The algorithm assigns a value to a based on the value of x, checking if x is negative, zero, or positive. According to foundational programming principles, conditional statements (if-else) are used to categorize inputs based on conditions.
Algorithm Analysis:
if x < 0: If x is negative, set a = 1.
else if x = 0: If x is zero, set a = 2. (Note: = is likely a typo for == in comparison.)
else: If x > 0 (positive), set a = 3.
Outcome: The algorithm categorizes x into three states: negative (x < 0), zero (x == 0), or positive (x > 0).
Option A: "Whether x is odd." Incorrect. The algorithm does not check parity (e.g., x % 2).
Option B: "Whether x is evenly divisible by 2 or 3." Incorrect. No divisibility checks (e.g., x % 2 or x % 3) are performed.
Option C: "Whether x is negative, 0, or positive." Correct. The conditions directly test x < \ 0, x == 0, and x > 0.
Option D: "Whether x is even." Incorrect. The algorithm does not test evenness.
Certiport Scripting and Programming Foundations Study Guide (Section on Conditional Statements).
Python Documentation: “If Statements” (https://docs.python.org/3/tutorial/controlflow.html#if-statements).
W3Schools: “C If Else” (https://www.w3schools.com/c/c_if_else.php).

Question No : 8


Given integer x = 12 and integer y = 4.
What is the value of the expression x - y * 2?

정답:
Explanation:
From Exact Extract:
The expression x - y * 2 involves subtraction and multiplication, evaluated according to operator precedence. According to foundational programming principles (e.g., C and Python standards), multiplication (*) has higher precedence than subtraction (-), so y * 2 is computed first.
Given: x = 12, y = 4.
Compute: y * 2 = 4 * 2 = 8.
Then: x - (y * 2) = 12 - 8 = 4.
Option A: "4." This is correct, as calculated above.
Option B: "6." This is incorrect. It might result from misinterpreting precedence (e.g., (x - y) * 2 = (12 - 4) *2=16).
Option C: "8." This is incorrect. It might result from computing x - y = 12 - 4 = 8 and ignoring * 2.
Option D: "14." This is incorrect. It does not align with the expression’s evaluation.
Certiport Scripting and Programming Foundations Study Guide (Section on Operator Precedence).
C Programming Language Standard (ISO/IEC 9899:2011, Section on Expressions).
W3Schools: “Python Operators” (https://www.w3schools.com/python/python_operators.asp).

Question No : 9


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

정답:
Explanation:
The code snippet not (g != S) contains two types of operators:
Equality Operator (!=): The expression g != S checks whether the value of g is not equal to the value of S. The != operator is used for comparison and returns True if the values are different, otherwise False.
Logical Operator (not): The not operator is a logical negation operator. It inverts the truth value of a Boolean expression. In this case, not (g != S) evaluates to True if g is equal to S, and False otherwise.
Therefore, the combination of these two operators results in the overall expression not (g != S).

Question No : 10


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

정답:
Explanation:
Here's the typical flow of the Waterfall software development model:
Analysis: This phase focuses on defining the problem and gathering detailed requirements for the software. Understanding the specific mathematical operations to support is a key part of this phase.
Design: Designers turn the requirements from the analysis phase into a concrete blueprint for the software. This includes architectural and detailed design decisions covering how those mathematical operations will be implemented.
Implementation: Developers take the design and translate it into working code, writing the modules and functions to perform the calculations.
Testing: Testers verify the software to ensure it meets the requirements, including testing how the implemented calculator functions handle different operations.
Maintenance: Ongoing support after deployment to address bugs and introduce potential changes or enhancements.
Why the other options are less accurate:
A. Design and Testing: While testing validates the calculator's functions, the determination of the required operations happens earlier in the process.
B. Implementation and Testing: Implementation builds the calculator, but the specifications and choice of operations happen before coding starts.
C. Design and Implementation: Though closely linked, the design phase finalizes the operation choices before implementation begins.

Question No : 11


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

정답:
Explanation:
From Exact Extract:
A function that calculates the average of two numbers (x and y) needs to take those numbers as inputs (parameters) and return their average as the output. According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), functions should accept necessary inputs and return computed results, avoiding unnecessary parameters or outputs.
Option A: "Parameters: x, y, average; Return value: none." This is incorrect. Including average as a parameter is unnecessary since it is the result to be computed. A function with no return value (void in C) would not provide the average to the caller, which defeats the purpose.
Option B: "Parameters: x, y; Return value: average." This is correct. The function needs x and y as
inputs to compute (x + y) / 2. The average is returned to the caller. For example, in Python: def average
(x, y): return (x + y) / 2.
Option C: "Parameters: none; Return values: x, y." This is incorrect. Without parameters, the function cannot access x and y to compute the average. Returning x and y is irrelevant to the task.
Option D: "Parameters: average; Return values: x, y." This is incorrect. average is the output, not an input, and returning x and y does not provide the computed average.
Certiport Scripting and Programming Foundations Study Guide (Section on Functions).
Python Documentation: “Defining Functions” (https://docs.python.org/3/tutorial/controlflow.html#defining-functions).
W3Schools: “C Functions” (https://www.w3schools.com/c/c_functions.php).

Question No : 12


What does the following algorithm determine?



정답:
Explanation:
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 integer x, if x % 2 equals 1, it means that x is 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 No : 13


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



정답:
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.

Question No : 14


What would a string be used to store?

정답:
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.

Question No : 15


Which expression has a value equal to the rightmost digit of the integer q = 7777?

정답:
Explanation:
From Exact Extract:
To find the rightmost digit of an integer q = 7777, we need the units digit (i.e., 7). According to foundational programming principles, the modulo operator (%) with 10 isolates the rightmost digit of a number.
Option A: "10 % q."
Compute: 10 % 7777 = 10 (since 10 ÷ 7777 has a remainder of 10).
Result: 10 # 7. Incorrect.
Option B: "q % 10."
Compute: 7777 % 10 = 7 (remainder of 7777 ÷ 10, isolating the units digit).
Result: 7 = rightmost digit. Correct.
Option C: "q / 10000."
Compute: 7777 / 10000 = 0.7777 (floating-point division).
Result: 0.7777 # 7. Incorrect.
Option D: "q % 10000."
Compute: 7777 % 10000 = 7777 (since 7777 < 10000).
Result: 7777 # 7. Incorrect.
Certiport Scripting and Programming Foundations Study Guide (Section on Modulo Operator).
C Programming Language Standard (ISO/IEC 9899:2011, Section on Multiplicative Operators).
W3Schools: “Python Operators” (https://www.w3schools.com/python/python_operators.asp).

 / 4
WGU