0% found this document useful (0 votes)
32 views12 pages

Scripting and Programming Foundations Free Dumps

Itfreedumps offers the latest online questions for various IT certifications, including Microsoft and Cisco. The document includes sample questions and answers related to programming concepts, Agile methodologies, and compiled languages. Each question is followed by an explanation of the correct answer, providing insights into foundational programming principles.

Uploaded by

donghuachan1281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views12 pages

Scripting and Programming Foundations Free Dumps

Itfreedumps offers the latest online questions for various IT certifications, including Microsoft and Cisco. The document includes sample questions and answers related to programming concepts, Agile methodologies, and compiled languages. Each question is followed by an explanation of the correct answer, providing insights into foundational programming principles.

Uploaded by

donghuachan1281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Itfreedumps provides the latest online questions for all IT certifications,

such as IBM, Microsoft, CompTIA, Huawei, and so on.

Hot exams are available below.

AZ-204 Developing Solutions for Microsoft Azure

820-605 Cisco Customer Success Manager

MS-203 Microsoft 365 Messaging

HPE2-T37 Using HPE OneView

300-415 Implementing Cisco SD-WAN Solutions (ENSDWI)

DP-203 Data Engineering on Microsoft Azure

500-220 Engineering Cisco Meraki Solutions v1.0

NACE-CIP1-001 Coating Inspector Level 1

NACE-CIP2-001 Coating Inspector Level 2

200-301 Implementing and Administering Cisco Solutions

Share some Scripting and Programming Foundations exam online


questions below.
1.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
Answer: B
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.

2.Which output results from the following pseudocode?


x=5
do
x=x+4
while x < 18
Put x to output
A. 9
B. 18
C. 21
D. 25
Answer: C
Explanation:
From Exact Extract:
The pseudocode uses a do-while loop, which executes the loop body at least once before checking
the condition. The variable x is updated by adding 4 each iteration, and the loop continues as long as
x < 18. The final value of x is output after the loop terminates. According to foundational programming
principles, we trace the execution step-by-step.
Initial State: x = 5.
First Iteration:
x = x + 4 = 5 + 4 = 9.
Check: x < 18 (9 < 18, true). Continue.
Second Iteration:
x = x + 4 = 9 + 4 = 13.
Check: x < 18 (13 < 18, true). Continue.
Third Iteration:
x = x + 4 = 13 + 4 = 17.
Check: x < 18 (17 < 18, true). Continue.
Fourth Iteration:
x = x + 4 = 17 + 4 = 21.
Check: x < 18 (21 < 18, false). Exit loop.
Output: Put x to output outputs x = 21.
Option A: "9." Incorrect. This is the value after the first iteration, but the loop continues.
Option B: "18." Incorrect. The loop stops when x >= 18, so x = 18 is not output.
Option C: "21." Correct. This is the final value of x after the loop terminates.
Option D: "25." Incorrect. The loop stops before x reaches 25.
Certiport Scripting and Programming Foundations Study Guide (Section on Loops).
Python Documentation: “While Statements” (https://docs.python.org/3/reference/compound_stmts.
html#while).
W3Schools: “C Do While Loop” (https://www.w3schools.com/c/c_do_while_loop.php).

3.A function should convert a Fahrenheit temperature (F) to a Celsius temperature.


What should be the output from the function?
A. C only
B. F only
C. F and C
D. F and 32
Answer: A
Explanation:
From Exact Extract:
A function that converts a Fahrenheit temperature (F) to Celsius (C) should output the Celsius value,
as the purpose is to perform the conversion. The formula is C = (F - 32) * 5 / 9. According to
foundational programming principles, a function’s output should be the computed result of its task.
Option A: "C only." This is correct. The function’s purpose is to convert F to C, so it should return the
Celsius temperature (e.g., in Python: def f_to_c(f): return (f - 32) * 5 / 9).
Option B: "F only." This is incorrect. Returning the input (Fahrenheit) does not accomplish the
conversion.
Option C: "F and C." This is incorrect. While the function could return both, the question asks for the
output of the conversion, which is C. Returning F is redundant.
Option D: "F and 32." This is incorrect. The constant 32 is part of the formula but not a meaningful
output, and F is the input, not the result.
Certiport Scripting and Programming Foundations Study Guide (Section on Functions and Return
Values).
Python Documentation: “Functions”
(https://docs.python.org/3/reference/compound_stmts.html#function-definitions).
W3Schools: “C Functions” (https://www.w3schools.com/c/c_functions.php).

4.What is a feature of a compiled programming language?


A. The program usually runs slower than an interpreted language.
B. The code runs directly one statement at a time by another program called a compiler.
C. The code must be compiled into machine code in the form of an executable file before execution.
D. The code does not require being translated into machine code but can be run by a separate
program called a compiler.
Answer: C
Explanation:
From Exact Extract:
A compiled programming language is one where the source code is translated into machine code (or
an intermediate form) by a compiler before execution. According to foundational programming
principles (e.g., Certiport Scripting and Programming Foundations Study Guide), this process results
in an executable file that can run independently of the compiler.
Option A: "The program usually runs slower than an interpreted language." This is incorrect.
Compiled languages (e.g., C, C++) typically produce machine code that runs faster than interpreted
languages (e. g., Python), as the translation to machine code is done beforehand, avoiding runtime
interpretation overhead.
Option B: "The code runs directly one statement at a time by another program called a compiler." This
is incorrect. A compiler translates the entire program into machine code before execution, not one
statement at a time. Running code one statement at a time is characteristic of an interpreter, not a
compiler.
Option C: "The code must be compiled into machine code in the form of an executable file before
execution." This is correct. In compiled languages like C or Java (which compiles to bytecode), the
source code is translated into machine code or an intermediate form (e.g., .exe or .class files) that
can be executed directly by the machine or a virtual machine.
Option D: "The code does not require being translated into machine code but can be run by a
separate program called a compiler." This is incorrect. A compiler’s role is to translate code into
machine code. Running code without translation describes an interpreted language, and the term
“compiler” is misused here.
Certiport Scripting and Programming Foundations Study Guide (Section on Compiled vs. Interpreted
Languages).
C Programming Language Standard (ISO/IEC 9899:2011).
W3Schools: “C Introduction” (https://www.w3schools.com/c/c_intro.php).

5.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. Design and implementation
C. Analysis and implementation
D. Design and testing
Answer: B
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/).
6.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.
Answer: D
Explanation:
A compiled language is one where the source code is translated into machine code by a compiler.
This machine code is specific to the type of machine it is compiled for, meaning the same compiled
code cannot be run on different types of machines without being recompiled. This process differs from
interpreted languages, where the source code is not directly converted into machine code but is
instead read and executed by an interpreter, which allows for cross-platform compatibility. Compiled
languages are known for their performance efficiency because the machine code is executed directly
by the computer’s hardware.

7.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.
A. Analysis and implementation
B. Analysis and design
C. Design and implementation
D. Design and testing
Answer: C
Explanation:
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.

8.Which operator is helpful in determining if an integer is a multiple of another integer?


A. /
B. $
C. | |
D. +
Answer: A
Explanation:
The operator that is helpful in determining if an integer is a multiple of another integer is the modulus
operator, represented by / in some programming languages and % in others. This operator returns
the remainder of the division of one number by another. If the remainder is zero, it indicates that the
first number is a multiple of the second. For example, 6 % 3 would return 0, confirming that 6 is a
multiple of 3.

9.What is put to output by the following flowchart, if the input is 3.5?


A. Backlog
B. Interview
C. Return
D. interview Backing
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

10.Which snippet represents the loop condition expression in the given code?
A. Integer f = 1
B. Put f to output
C. F<27
D. F = f + 2
Answer: C
Explanation:
The loop condition expression is the part of a loop that determines whether the loop will continue to
execute or terminate. It is evaluated before each iteration of the loop, and if it evaluates to true, the
loop body is executed; if it evaluates to false, the loop terminates. In the options provided, F < 27 is a
Boolean expression that checks if f is less than 27, which is typical of a loop condition used to control
the number of iterations of the loop.

11.Which kind of languages are C and Java?


A. Machine code
B. Compiled
C. Interpreted
D. Markup
Answer: B
Explanation:
From Exact Extract:
C and Java are both compiled languages, though they differ in their compilation process. According to
foundational programming principles, C is compiled directly to machine code, while Java is compiled
to bytecode, which is executed by the Java Virtual Machine (JVM).
Option A: "Machine code." This is incorrect. Machine code is the low-level output of a compiler, not a
programming language. C and Java are high-level languages.
Option B: "Compiled." This is correct. C is compiled to machine code (e.g., .exe files), and Java is
compiled to bytecode (.class files), which is then executed by the JVM. Both require a compilation
step before execution.
Option C: "Interpreted." This is incorrect. Neither C nor Java is interpreted. While Java’s bytecode is
executed by the JVM, the compilation to bytecode distinguishes it from interpreted languages like
Python, which execute source code directly.
Option D: "Markup." This is incorrect. Markup languages (e.g., HTML) are used for structuring
content, not programming. C and Java are programming languages.
Certiport Scripting and Programming Foundations Study Guide (Section on Compiled Languages).
Java Documentation: “The Java Compiler”
(https://docs.oracle.com/javase/8/docs/technotes/tools/windows /javac.html).
W3Schools: “C Introduction” (https://www.w3schools.com/c/c_intro.php).

12.What is the proper way to declare a student’s grade point average throughout the term if this item
is needed in several places in a program?
A. Variable float gpa
B. Constant float gpa
C. Variable int gpa
D. Constant int gpa
Answer: A
Explanation:
From Exact Extract:
A grade point average (GPA) is a numerical value that typically includes decimal places (e.g., 3.75).
According to foundational programming principles, it should be declared as a variable if it may change
(e.g., as grades are updated) and as a floating-point type to accommodate decimals.
Option A: "Variable float gpa." This is correct. GPA requires a floating-point type (float) to handle
decimal values, and since it may change over the term, it should be a variable, not a constant. For
example, in C: float gpa = 3.5;.
Option B: "Constant float gpa." This is incorrect. A constant (const in C) cannot be modified after
initialization, but GPA may change as new grades are added.
Option C: "Variable int gpa." This is incorrect. An integer (int) cannot store decimal values, which are
common in GPAs (e.g., 3.2).
Option D: "Constant int gpa." This is incorrect. GPA requires a float for decimals and a variable for
mutability, making both const and int unsuitable.
Certiport Scripting and Programming Foundations Study Guide (Section on Variables and Data
Types).
C Programming Language Standard (ISO/IEC 9899:2011, Section on Floating Types).
W3Schools: “C Variables” (https://www.w3schools.com/c/c_variables.php).

13.What is an argument?
A. A piece of information provided in a function call
B. A declared piece of information within a function
C. A piece of information assigned to a function's output
D. An input named in the definition of a function
Answer: A
Explanation:
In programming, an argument is a value that is passed to a function when it is called. The function
can then use that information within its scope as it runs. Arguments are often used interchangeably
with parameters, but they refer to the actual values provided to the function, while parameters are the
variable names listed in the function’s definition that receive the argument values12.
For example, consider a function calculateSum that takes two arguments, a and b:
Python
def calculateSum(a, b):
return a + b
# Here, 5 and 3 are arguments provided in the function call. result = calculateSum(5, 3)
AI-generated code. Review and use carefully. More info on FAQ.
In this case, 5 and 3 are the arguments provided in the function call to calculateSum. They are not
declared within the function (option B), not assigned to the function’s output (option C), nor are they
inputs named in the definition of the function (option D). Instead, they are pieces of information
provided during the function call, which aligns with option A.

14.Given integer x = 12 and integer y = 4


What is the value of the expression x + y12?
A. 6
B. 8
C. 14
Answer: C
Explanation:
The expression given is (x + y^{12}), with (x = 12) and (y = 4).
To evaluate this expression, we substitute the values of (x) and (y) into the expression:
(x + y^{12} = 12 + 4^{12})
Since (4^{12}) is a very large number, the significant value in this expression comes from (4^{12}),
and the addition of 12 does not change the order of magnitude of the result. Therefore, the value of (x
+ y^{12}) is much greater than the options provided (A. 6, B. 8, C. 14). It seems there might be a typo
in the expression or the options provided.
If the expression was meant to be (x + y \times 12), then the answer would be:
(x + y \times 12 = 12 + 4 \times 12 = 12 + 48 = 60)
However, since this option is not available, and based on the provided options, the closest correct
answer, assuming the expression is (x + y), would be:
(x + y = 12 + 4 = 16)
But since 16 is not an option, and without further context, the best match from the given options would
be C. 14, even though it is not the exact answer.

15.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?
A. Testing
B. Analysis
C. Design
D. Implementation
Answer: C
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).

16.1.Review the following sequence diagram:

What does a sequence diagram do?


A. Shows interactions awl indicates an order of events
B. Shows interactions but does not specify an order of events
C. Shows sialic elements of software
D. Shows an order of events but does not specify all interactions
Answer: A
Explanation:
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.

17.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
Answer: D
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/).

18.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)
Answer: C F
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

19.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()
Answer: C D
Explanation:
From Exact Extract:
A valid function call invokes a function by its name, providing the required number and type of
arguments in the correct syntax. According to foundational programming principles (e.g., Certiport
Scripting and Programming Foundations Study Guide), function calls must follow the language’s
syntax rules, typically function_name(arguments).
Option A: "function sample(float 2.0)." This is incorrect. This resembles a function definition (declaring
a function named sample with a parameter), not a function call. A call would be sample(2.0).
Option B: "GetHeight(integer 3, 4)." This is incorrect. The syntax integer 3 is invalid in most languages
for a function call. A correct call might be GetHeight(3, 4), assuming GetHeight accepts two integers.
The inclusion of type keywords (integer) is not typical in function calls.
Option C: "round(4.723, 2)." This is correct. In languages like Python, round(4.723, 2) is a valid call to
the built-in round function, which takes a float and an integer (number of decimal places) and returns
a rounded value (e.g., 4.72).
Option D: "PrintSample()." This is correct. Assuming PrintSample is a defined function with no
parameters, PrintSample() is a valid call (e.g., in Python: def PrintSample(): print("Sample")).
Certiport Scripting and Programming Foundations Study Guide (Section on Functions and Function
Calls).
Python Documentation: “Built-in Functions” (https://docs.python.org/3/library/functions.html#round).
W3Schools: “C Functions” (https://www.w3schools.com/c/c_functions.php).

20.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
Answer: B
Explanation:
The expression ((x % 8) - y) involves the modulo operation and subtraction. The modulo operation
finds the remainder when (x) is divided by (8). Given (x = 41), we calculate (41 % 8) which equals (1)
because (41) divided by (8) equals (5) with a remainder of (1).
Then, we subtract (y) (which is (16)) from this remainder:
(41%8)#16=1#16=#15
However, there seems to be a discrepancy here as the calculation shows the answer should be (-15),
but this is not an option provided in your question. Please double-check the options or the expression
provided.

21.What is an accurate way to describe a statically typed language?


A. It uses methods that that produce consistent output based upon the arguments passed to those
methods.
B. It includes custom variable types with methods, information hiding, data abstraction, encapsulation,
polymorphism, and inheritance.
C. It is based on the concept of modularization and calling procedures or subroutines.
D. It requires a large number of variables and variable conversions because of the need to commit to
a variable type throughout the life of the program.
Answer: D
Explanation:
A statically typed language is one where the type of a variable is known at compile time. This means
that the type of each variable must be declared and does not change throughout the program’s
execution. While this can lead to a larger number of variable declarations and sometimes
conversions, it also allows for type checking at compile time, which can catch many errors before the
program runs. Statically typed languages include Java, C, C++, and others123.

Get Scripting and Programming Foundations


exam dumps full version.

Powered by TCPDF (www.tcpdf.org)

You might also like