Values, names and arithmetic
What does this program print? Choose an answer and how sure you are, then seal it.
Predict the output
Dry run this program. Add a row each time a name gets a value, or the program prints.
Dry run (trace table)
Put the lines in order so the program swaps the values of a and b, then prints them. One line is not needed.
Order the lines
What does each line print? Answer all four, then seal them together.
Predict the output
This program should read an age and print the age next year, but it stops with an error. Tap the line at fault, then choose a fix.
Find the bug
Read a price in whole naira, then a quantity. Print the total cost, as a whole number and nothing else.
Write: runs your program
Tips
- Do the tasks in order the first time. Each one uses what the one before taught.
- Write tasks run your program. The others need only taps.