CSE 1321 COMPREHENSIVE EXAM 2026/2027
QUESTIONS AND SOLUTIONS RATED A+
✔✔What will be displayed on the console after the following code is executed?
x ← 22
IF (x > 0) THEN
PRINT ("A")
ELSE IF (x > 10 ) THEN
PRINT ("B")
ELSE
PRINT ("C")
END IF - ✔✔A
✔✔What will be displayed on the console after the following code is executed?
x ← 10
IF (x > 10) THEN
PRINT ("AB")
ELSE
PRINT ("CD")ENDIF
PRINT ("E") - ✔✔None of the other answers
✔✔Limitations regarding where a variable can and cannot be seen inside of a program
is know as: - ✔✔scope
✔✔Selection structures allow us the ability to modify the order of statement execution
based on boolean expressions. - ✔✔True
✔✔This alternative to an if will cause a block of code to execute if a Boolean expression
is false. - ✔✔else
✔✔This statement tests a series of conditions and will execute a block of code when it
finds one is true. - ✔✔is-else-if
✔✔This logical operator will return true if either or both conditions are true. - ✔✔Logical
OR
✔✔What will display to the screen when the following code executes?
age ← 55
IF(age >= 16 && age <=80) THEN
PRINTLINE("You can drive!")
ENDIF
PRINT ("Be safe!") - ✔✔You can drive!
Be safe!
QUESTIONS AND SOLUTIONS RATED A+
✔✔What will be displayed on the console after the following code is executed?
x ← 22
IF (x > 0) THEN
PRINT ("A")
ELSE IF (x > 10 ) THEN
PRINT ("B")
ELSE
PRINT ("C")
END IF - ✔✔A
✔✔What will be displayed on the console after the following code is executed?
x ← 10
IF (x > 10) THEN
PRINT ("AB")
ELSE
PRINT ("CD")ENDIF
PRINT ("E") - ✔✔None of the other answers
✔✔Limitations regarding where a variable can and cannot be seen inside of a program
is know as: - ✔✔scope
✔✔Selection structures allow us the ability to modify the order of statement execution
based on boolean expressions. - ✔✔True
✔✔This alternative to an if will cause a block of code to execute if a Boolean expression
is false. - ✔✔else
✔✔This statement tests a series of conditions and will execute a block of code when it
finds one is true. - ✔✔is-else-if
✔✔This logical operator will return true if either or both conditions are true. - ✔✔Logical
OR
✔✔What will display to the screen when the following code executes?
age ← 55
IF(age >= 16 && age <=80) THEN
PRINTLINE("You can drive!")
ENDIF
PRINT ("Be safe!") - ✔✔You can drive!
Be safe!