PROGRAMMING COMPREHENSIVE EXAM 2026
QUESTIONS WITH SOLUTIONS GRADED A+
◉ A program determines if a user's age is high enough to run for U.S.
president. The minimum age requirement is 35.
How should the item that holds the minimum age be declared?
A Constant integer minAge
B Variable integer minAge
C Constant integer 35
D Variable integer 35. Answer: Constant integer minAge
◉ What kind of operator is the == in the expression i == 20?
A Assignment
B Arithmetic
C Equality
D Logical. Answer: Equality
◉ What is the purpose of parentheses () in a programming expression?
A To print expressions
,B To group expressions
C To run expressions
D To compose expressions. Answer: To group expressions
◉ Which data type is used for items that are measured in length?
A Integer
B Float
C String
D Boolean. Answer: B
◉ Which data type should be used to keep track of how many planes are
in a hangar?
A Integer
B Float
C String
D Boolean. Answer: A
◉ A function should convert hours and minutes to seconds, such as
converting 1 hour and 10 minutes to 4,200 seconds.
What should be the input to the function?
A Hours only
, B Minutes only
C Hours and minutes
D Hours, minutes, and seconds. Answer: C
◉ What is a valid user-defined function name?
A A reserved word
B Any valid identifier
C Any variable name
D A floating-point number. Answer: B
◉ What is the loop variable initialization in the following pseudocode?
y=0
s = 100.0
while y < 10
s = s + (s * 5.0)
y=y+1
Ay=0
By=y+1
C s = 100.0
D s = s + ( s * 5.0). Answer: A