PROGRAMMING FOUNDATIONS OA FINAL
EXAM TEST BANK 2026/2027 WITH ACTUAL
CORRECT QUESTIONS AND VERIFIED
DETAILED ANSWERS |CURRENTLY TESTING
QUESTIONS AND SOLUTIONS|ALREADY
GRADED A+|NEWEST |BRAND NEW
VERSION|JUST RELEASED!!
What are the three parts of a loop?
Initialization — This is where you set up a starting point for the loop
Condition (or test expression) — This is the logical test that determines whether the loop
continues or stops. The loop will run as long as this condition is true.
Update (or increment/decrement) — This adjusts the control variable to move it closer to the
stopping condition, preventing an infinite loop.
What is difference in a while loop and do/while loop?
While loop:
Condition is checked first — if the condition is false at the start, the loop may never run.
Do/while loop:
Executes at least once — the condition is checked after the first iteration
Which control structure is guaranteed to run only one time?
1|Page
,The do/while loop (found in other languages like C or Java) will always run at least once — but
it's not guaranteed to stop after just one run unless the condition becomes false immediately
after the first iteration......
guaranteed to run only one time is a selection (if) statement — not a loop.
Which loop is used when you are unsure how many times you may need to iterate?
while loop is used when you are unsure how many times you may need to iterate.
It keeps running as long as a condition is true — so it’s perfect for situations where you don’t
know in advance how many iterations you’ll need.
• Which loop is used when you know how many times you want to iterate?
for loop is used when you know exactly how many times you want to iterate.
It allows you to iterate over a sequence (like a list, range, or string) or a specific number of
times.
What is a function?
reusable block of code that performs a specific task. It is designed to take inputs (known
as parameters or arguments), process them, and return an output (though not always).
Functions allow you to organize your code, make it more modular, and avoid repetition.
Key characteristics of a function:
Input (parameters): Information the function needs to perform its task.
Code block: The series of instructions or operations the function performs.
Output (return value): The result that the function gives after performing its task (optional).
Why are functions useful?
Code Reusability:
Organization and Readability:
Abstraction:
2|Page
,Debugging and Maintenance:
Avoiding Repetition (DRY Principle):
Improves Collaboration:
Testing:
Parameterization:
What is a function call?
when you invoke or execute a function that has been defined elsewhere in the code.
What are parameters and arguments?
Parameters are the variables defined in the function’s declaration or definition
Arguments are the actual values you pass to the function when you call it.
What does a return statement do?
is used in a function to send a value back to the caller when the function finishes executing. It
marks the end of the function and can optionally pass back a value or expression to the place
where the function was called.
What is a linear search?
linear search (also called a sequential search) is a simple search algorithm that checks each
element in a list or array one by one until it finds the target value or reaches the end of the list.
Start from the first element: The search begins at the beginning of the list.
Compare each element: The algorithm compares each element in the list to the target value.
Return the index (or value): If a match is found, it returns the index or the value of the element.
If the list ends without finding the target, it indicates that the target isn't in the list.
What is SDLC?
3|Page
, SDLC stands for Software Development Life Cycle. It is a structured process or methodology
used to design, develop, and maintain software systems. The goal of SDLC is to produce high-
quality software that meets customer requirements and is delivered on time and within budget.
What are the four phases of SDLC?
1.Planning (or Requirement Analysis)
2.Design
3.Development (or Implementation)
4.Testing (or Deployment and Maintenance)
What activities takes place in each of the four phases?
Planning (or Requirement Analysis)
Activities: Identify project goals, objectives, and deliverables. Collect detailed user and system
requirements.
Assess resources, budgets, timelines, and constraints.
Plan for risks, project milestones, and schedules.
Design
Activities: High-level design (system architecture, components).
Detailed design (modules, interfaces, database schemas). Define technologies and tools to be
used.
Create prototypes or wireframes (if applicable).
Development (or Implementation)
Activities:
Developers write the code in chosen programming languages.
Create databases, interfaces, and other components.
4|Page