Spec 2.2 and 2.3 ยท Programming
Code Tracer
Dry-run OCR Exam Reference Language in your head and predict the output โ or hunt the bug.
Score 0
Streak 0
Best 0
Exam Reference Language quick guide
x = 5 // assignment
const VAT = 0.2 // constant
name = input("Name?") // input (always a string)
print("Hi " + name) // output and concatenation
if x > 3 then โฆ elseif โฆ else โฆ endif
switch x: case 1: โฆ default: โฆ endswitch
for i = 1 to 10 step 2 โฆ next i
while x < 10 โฆ endwhile
do โฆ until x == 10
array nums = [3, 7, 1] // arrays start at index 0
grid[1,2] // 2D array
word.length word.upper word.lower
word.substring(start, length) word.left(n) word.right(n)
ASC("A") โ 65 CHR(65) โ "A"
str(5) int("5") float("2.5") bool("True") // casting
+ - * / ^ (power) MOD (remainder) DIV (whole-number division)
== != < <= > >= AND OR NOT
function f(x) โฆ return โฆ endfunction
procedure p(x) โฆ endprocedure
random(1, 6) // random integer 1 to 6