CSE 1321 EVALUATION EXAM 2026/2027 QUESTIONS
AND SOLUTIONS RATED A+
✔✔abstraction - ✔✔In computing:
-Abstraction refers to the LOGICAL GROUPING of
concepts or objects
-We want to hide the details (in functions - later)
-We like to think at a high level of abstraction (no details)
-Too many details overwhelm us!
✔✔Algorithms can be created using - ✔✔-Natural language (e.g. English)
-Pictures or flowcharts
-Pseudocode or a specific programming language
✔✔Pseudocode - ✔✔-It's a mixture of languages
-Not concerned with syntax, but concepts
✔✔Any computing algorithm will have AT MOST five kinds of components: - ✔✔-Data
structures to hold data
• Instructions to change data value
• Conditional expressions to make decisions
• Control structures to act on decisions
• Modules to make the algorithm manageable by abstraction (i.e., grouping related
components)
✔✔A good algorithm exhibits - ✔✔precision, clarity, completeness, correctness, and
simplicity.
✔✔An algorithm is just - ✔✔a set of instructions
✔✔Abstraction is just - ✔✔the level of detail
✔✔Skeleton programs: - ✔✔-Are the smallest program you can write
-Are the minimal amount of code that compiles
-Do NOTHING
-Define the entry/starting point of the program
✔✔A variable: - ✔✔-Is a chunk of the computer's memory
-Can hold a value
-Is of a particular "type"
Integer
Floating point number
Character
String - which is just text
, ✔✔Variables: Usually, it's two steps: - ✔✔-"Declare" the variable - tell the computer
what it is (do this only once)
-Assign values to the variable
✔✔Basic Operators - ✔✔Math Operators
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
✔✔An ------ is a combination of one or more operators and operands - ✔✔expression
✔✔It has both a data type and a value that results from the expression evaluation -
✔✔expression
✔✔Operands may be: - ✔✔- literals
-constants
-variables
✔✔Arithmetic Operators - ✔✔+ addition
- subtraction
* multiplication
/ division
% modulus (say what?)
✔✔When dividing two integer values: - ✔✔- the quotient is an integer
-the remainder is truncated (discarded)
✔✔To get the ------, use the modulus operator with the same operands - ✔✔remainder
✔✔Operator Precedence - ✔✔Left-to-right operations
- multiplication, division and modulus
- addition and subtraction (example 3 + 3)
- string concatenation ("Hello, " + "world!")
Right-to-left operations
- unary plus and unary minus (example, +1 or -1)
- assignment
✔✔Variable = expression; - ✔✔1) the expression on the right side of the = operator is
evaluated Expression has data type and value
2) the result is stored in the variable on the left if the types are compatible (overwriting
the original value)
✔✔Shortcut Operators - ✔✔++ increment by 1
AND SOLUTIONS RATED A+
✔✔abstraction - ✔✔In computing:
-Abstraction refers to the LOGICAL GROUPING of
concepts or objects
-We want to hide the details (in functions - later)
-We like to think at a high level of abstraction (no details)
-Too many details overwhelm us!
✔✔Algorithms can be created using - ✔✔-Natural language (e.g. English)
-Pictures or flowcharts
-Pseudocode or a specific programming language
✔✔Pseudocode - ✔✔-It's a mixture of languages
-Not concerned with syntax, but concepts
✔✔Any computing algorithm will have AT MOST five kinds of components: - ✔✔-Data
structures to hold data
• Instructions to change data value
• Conditional expressions to make decisions
• Control structures to act on decisions
• Modules to make the algorithm manageable by abstraction (i.e., grouping related
components)
✔✔A good algorithm exhibits - ✔✔precision, clarity, completeness, correctness, and
simplicity.
✔✔An algorithm is just - ✔✔a set of instructions
✔✔Abstraction is just - ✔✔the level of detail
✔✔Skeleton programs: - ✔✔-Are the smallest program you can write
-Are the minimal amount of code that compiles
-Do NOTHING
-Define the entry/starting point of the program
✔✔A variable: - ✔✔-Is a chunk of the computer's memory
-Can hold a value
-Is of a particular "type"
Integer
Floating point number
Character
String - which is just text
, ✔✔Variables: Usually, it's two steps: - ✔✔-"Declare" the variable - tell the computer
what it is (do this only once)
-Assign values to the variable
✔✔Basic Operators - ✔✔Math Operators
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
✔✔An ------ is a combination of one or more operators and operands - ✔✔expression
✔✔It has both a data type and a value that results from the expression evaluation -
✔✔expression
✔✔Operands may be: - ✔✔- literals
-constants
-variables
✔✔Arithmetic Operators - ✔✔+ addition
- subtraction
* multiplication
/ division
% modulus (say what?)
✔✔When dividing two integer values: - ✔✔- the quotient is an integer
-the remainder is truncated (discarded)
✔✔To get the ------, use the modulus operator with the same operands - ✔✔remainder
✔✔Operator Precedence - ✔✔Left-to-right operations
- multiplication, division and modulus
- addition and subtraction (example 3 + 3)
- string concatenation ("Hello, " + "world!")
Right-to-left operations
- unary plus and unary minus (example, +1 or -1)
- assignment
✔✔Variable = expression; - ✔✔1) the expression on the right side of the = operator is
evaluated Expression has data type and value
2) the result is stored in the variable on the left if the types are compatible (overwriting
the original value)
✔✔Shortcut Operators - ✔✔++ increment by 1