Foundations OA Final Actual Exam Test Bank 1
Newest 2026-2027 With Complete Questions And
Correct Detailed Answers| Brand New Version!
What is the purpose of a variable ?
a variable stores data or values in a program so they can be reused or
manipulated during the program's execution
How do you save a value to a variable?
By using an assignment statement (=), where the variable is on the left
hand side and the value or express is on the right hand side
What is a programming expression?
an expression is a combination or variables, literals, operators and/or
functions that evaluates to a value. example: x+2 is an expression
What is an identifier?
1|Page
,An identifier is the name given to variables, functions or other program
elements, used to identify them in code.
What constitutes a valid identifier?
a valid identifier must begin with a letter or an underscore, contains
only letters, digits, and underscores. Not be a reserved keyword of the
programming language, case sensitive
What is a literal?
A literal is a specific fixed value written directly in the code, such as
'HELLO'
What is an operator?
A operator is a symbol that performs operations on variables and
values. example: + for addition, - for subtraction
What precedence rules does programming use?
programming uses mathematical precedence rules: () Parentheses
come first, unary operators (like- )follow. Multiplication * , division /,
2|Page
,and modulo % have equal precedence. Addition + and subtraction - are
evaluated last.
How does an integer differ from a float?
integer: stores whole numbers (example: 1, 42, -10) Float: stores
decimal numbers (example 3.01, 0.5, -2.0)
What happens if you divide two integers? A integer and float?
Dividing two integers typically results in an integer (with truncation) in
some languages or a float in others. (example: Python 3, diving an
integer and float provides a float result. )
What happens if you divide a nonzero floating point number by zero?
It results in "infinity" or "-infinity", depending on the signs of the
operands. If both operands are zero, the result is "NOT A NUMBER"
(NAN)
How do you convert an item's type?
3|Page
, By using type conversion or casting functions, such as INT(),FLOAT(), or
STR()
What does the modulo operator do?
the modulo operator (%) returns the remainder of a division operation.
example 7%3 results in 1.
What is the difference in a variable and a constant?
a variable can change its value during program execution. A constant
retains its value throughout execution and is often defined as
immutable and cannot be modified.
How does an array work?
an array is a data structure that stores multiple values of the same type
in an indexed format, allowing easy access to elements.
What does index reference?
an index refers to the position of an element in an array or list, usually
starting from 0.
4|Page