Students will be able to:
-
Describe how variables store values and how they are used in your program.
Computer Science: Programming -
Explain how sequence works in programming.
Computer Science: Programming
Challenge Level: Beginner
This programming challenge is linked to the following lessons:
Students will be able to:
Write a program to display numbers 1, 2, 4, 8 and 16 on the screen one at a time. Instead of displaying the number directly, you should store it into a variable, and display the variable.
The output will always show the numbers 1, 2, 4, 8 and 16 (there is no input).
Click on the green flag to see the expected output of your program.
when green flag clicked
set [number of dots v] to [1]
set [number of dots v] to [2]
set [number of dots v] to [4]
set [number of dots v] to [8]
set [number of dots v] to [16]
say (number of dots) for (1) secs
say (number of dots) for (1) secs
say (number of dots) for (1) secs
say (number of dots) for (1) secs
say (number of dots) for (1) secs
set [number of dots v] to [0]
block to set the value of
your new variable.say [Hello] for (2) secs
block with your variable.Display the numbers from largest to smallest (display numbers 16, 8, 4, 2 and 1).