Repeat it
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 reads a whole number n and prints the sum of the whole numbers from 1 to n. One line is not needed.
Order the lines
Fill the gaps so the program prints the whole numbers from 1 to 10, one per line.
Fill the gap
This program should read a whole number n and print the sum of the whole numbers from 1 to n. It prints the wrong total. Tap the line at fault, then choose a fix.
Find the bug
Read whole numbers, one per line, until a line holds 0. Then print their total and how many numbers there were, not counting the 0, on one line with a space between them. Use a while loop.
Write: runs your program
Read a whole number of 1 or more, and print how many digits it has. This task practises loops, so your program must use one.
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.