Foundations OA Exam Study Guide – Complete
Practice Exam with 100% Verified Correct
Answers and Detailed Rationales | Latest Update -
2026/2027 | Already Graded A+
Question 1
A combination of items, like variables, literals, operators, and parentheses, that
evaluates to a value. Ex: 2 * (x + 1) is an expression. If x is 3, the expression
evaluates to the value 8.
A. Expression
B. Design
C. Input
D. Variables
Answer: A
Rationale: An expression is a combination of variables, literals, operators, and
parentheses that evaluates to a value. For example, 2 * (x + 1) evaluates to 8 when
x = 3. The other options are not definitions of an expression.
Question 2
A behavioral diagram that shows interaction between software components and
indicates the order of events.
A. Sequence diagram
B. Use case diagram
C. Life diagram
D. Object diagram
Answer: A
Rationale: A sequence diagram is a behavioral diagram that shows interactions
between software components and the order of events over time. Use case
pg. 1
,diagrams show user interactions; class diagrams show structure; object diagrams
show instances.
Question 3
What is the loop variable initialization in the following pseudocode?
y=0
s = 100.0
while y < 10
s = s + (s * 5.0)
y=y+1
A. y = 0
B. s = s + (s * 5.0)
C. y = y + 1
D. s = 100.0
Answer: A
Rationale: The loop variable initialization is the statement that sets the loop
variable to its starting value before the loop begins. Here, y = 0 initializes the loop
variable. The loop expression is y < 10; the update is y = y + 1.
Question 4
A variable's type may change while a program executes, based on what is assigned
to the variable.
A. Dynamically typed
B. Weekly typed
C. Strongly typed
D. Statically typed
Answer: A
Rationale: Dynamically typed languages allow a variable's type to change during
execution based on what is assigned (e.g., Python, JavaScript). Statically typed
languages require type declaration and do not allow type changes (e.g., C, Java).
pg. 2
,Question 5
Consists of the function name and parentheses, within which comma-separated
arguments (if any) appear.
A. Function call
B. Process
C. Design
D. None of these
Answer: A
Rationale: A function call consists of the function name followed by parentheses,
with arguments separated by commas inside the parentheses. For example,
myFunction(2, 3). A process is a program in execution.
Question 6
What is the return value of a function?
A. Variable in the declaration of the function
B. Data passed to the function
C. Call to run the function
D. Output of a function
Answer: D
Rationale: The return value is the output of a function—the data the function
produces and sends back to the caller. Parameters are inputs to the function; a
function call invokes the function.
Question 7
An ordered list of items of a given data type.
A. Array
B. Object
C. Loop
D. String
Answer: A
Rationale: An array is an ordered list of items of the same data type (e.g., an array
of integers). A string is a sequence of characters; an object is an instance of a class;
a loop is a control structure.
pg. 3
, Question 8
What does the following algorithm determine?
if x == y
z=1
else
z=0
A. Whether x is 0
B. Whether x and y are negative
C. Whether x is 1
D. Whether x and y are the same
Answer: D
Rationale: The algorithm checks if x and y are equal. If they are the same, z is set
to 1; otherwise, z is set to 0. It does not check for negativity, zero, or whether x is 1
specifically.
Question 9
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?
A. Design
B. Analysis
C. Testing
D. Implementation
Answer: C
Rationale: Testing is the phase where the program is run with various inputs to
verify correct outputs. This validates the program's functionality. Design and
Analysis occur before coding; Implementation is writing the code.
Question 10
What is an advantage of using a programming library?
pg. 4