Six exam-style questions, weighted toward booleans and decisions. Two are cumulative from set 1.
One question asks you to select all that apply. The real exam has eight of those in seventy, and they are marked the same way: every correct option and no incorrect ones.
Set a timer for 10 minutes. On paper, no computer, and mark each answer sure or unsure.
In exam notation, IF(a = b) asks whether:
a is being assigned the value of ba and b are equala is not equal to b==In Lua, 5 ~= 5 evaluates to:
truefalsenil!=What does this print?
local speed = 7
if speed > 10 then print("fast")elseif speed > 5 then print("medium")elseif speed > 0 then print("slow")else print("stopped")endfastmediumslowmedium and slowhp holds 0. What does this display?
IF(hp ≤ 0){ DISPLAY("Game over")}ELSE{ DISPLAY("Keep going")}Game overKeep goingWhich of these evaluate to true?
3 > 1 and 2 > 53 > 1 or 2 > 5not (3 > 1)5 >= 5This is meant to move only on a or d. What actually happens?
local key = "x"
if key == "a" or "d" then print("moving")endkey is "x"moving prints, for any value of key"d" is not a conditionmoving prints only when key is "d"Six answers with sure or unsure beside each, and your time. For question 5, list every letter you chose.
Worth 4 points, graded on completion.