PROGRAMMING FINAL TEST 2026
QUESTIONS WITH CORRECT ANSWERS
GRADED A+
◍ behavioral, structural, behavioral.
Answer: A UML use case diagram is __ and shows how a user interacts with
a program. A class diagram is __ and shows a program's classes. A sequence
diagram is __ and shows interactions and event orderings.
◍ floating-point number.
Answer: A __ is a real number, like 98.6, 0.0001, or -666.667.
◍ Why are programming libraries used?.
Answer: To save time and avoid reinventing the wheel.
◍ nested branches.
Answer: A branch's statements can include any valid statements, including
another if-else branch, known as __.
◍ What does an output of 1 indicate for: while i < 5 if list[i] < 0 x = 1?.
Answer: At least one negative number in the list
◍ the inner loop and outer loop..
Answer: The nested loops are commonly referred to as
◍ In which phase do you write code?.
Answer: Implementation phase.
◍ What is the loop expression in i = 0; while i < 20 ...?.
Answer: i < 20
◍ The analysis phase defines a program's goals.The design phase defines
, specifics of how to build a program.The implementation phase involves
writing the program.The testing phase checks that the programs correctly
meets the goals..
Answer: systems development life cycle
◍ What is the return value of a function?.
Answer: The value provided back to the caller
◍ What are the three logical operators?.
Answer: AND (&& or and), OR (|| or or), NOT (! or not).
◍ agile approach / spiral approach.
Answer: A program can be built by doing small amounts of each SDLC
phases in sequence, and then repeating, known as the agile approach (or
spiral approach).
◍ class diagram.
Answer: A UML __ is a structural diagram that can be used to visually
model the classes of a computer program, including data members and
functions.
◍ Do-while loop.
Answer: Joe is building an online game. He wants to provide a riddle and
have the player guess the answer. The game needs to prompt the user to
enter the answer, check to see if it the input provided does not match the
correct answer, and continue prompting the user until the answer entered
matches the correct answer. Which control structure supports Joe's needs?
◍ false.
Answer: Programmers often use loops to execute a computation until a done
condition is reached. That done condition is reached when the loop
expression is ___.
◍ Pseudocode.
Answer: __ is text that resembles a program in a real programming language
but is simplified to aid human understanding.
,◍ What is difference in a while loop and do/while loop?.
Answer: while checks condition before executing the loop body.do/while
executes the body at least once before checking condition.
◍ Which UML diagrams are activity?.
Answer: Activity diagrams model workflows and processes.
◍ ==.
Answer: A __ b means a is equal to b.
◍ industrial age.
Answer: The __ starting in the late 1700's transformed civilization towards
manufacturing goods, leading to mass migration to cities, creation of strong
nations, world wars, doubling of lifespans and thus dramatic world
population growth (see figure below), and more.
◍ Converts to machine language before running.
Answer: What is a characteristic of a compiled language?
◍ bit.
Answer: A single 0 or 1 is called a __.
◍ parameter.
Answer: A __ is a function input specified in a function definition.
◍ What is a use case diagram used for?.
Answer: Modeling system functionality from user perspective.
◍ What is the value of x / y if x = 10.2 and y = 1.0?.
Answer: 10
◍ function stub.
Answer: A __ is a function definition whose statements have not yet been
written.
◍ relational operator.
Answer: A __ checks how one operand's value relates to another, like being
greater than.
, ◍ interpreter.
Answer: An __ runs a program's statements.
◍ Statically typed.
Answer: A programmer wants a compiler to report an error if an integer
variable is assigned with a string. Which kind of language should the
programmer use?
◍ seed.
Answer: For the first call to RandomNumber(), no previous random integer
exists, so the function uses a built-in integer known as the __.
◍ 'Hello' will print indefinitely..
Answer: A programmer has developed the following code: count = 0while
count is less than 5: print 'Hello' What is the result of implementing this
code?
◍ case sensitive.
Answer: Identifiers are __, meaning upper and lower case letters differ.
◍ Explain the precedence rules..
Answer: Logical NOT has highest precedence, then AND, then OR.
◍ Abstraction / information hiding / encapsulation.
Answer: Abstraction means to have a user interact with an item at a
high-level, with lower-level internal details hidden from the user (aka
information hiding or encapsulation).
◍ What are the three parts of a loop?.
Answer: Initialization, condition, and iteration (update).
◍ array.
Answer: An __ is a special variable having one name, but storing a list of
data items, with each item being directly accessible.
◍ What does the following algorithm determine? if x == y then z = 1 else z =
0.
Answer: Whether x equals y