×

Challenges

  1. Not started

  2. Not started

  3. Not started

  4. Not started

  5. Not started

  6. Not started

  7. Not started

  8. Not started

  9. Not started

  10. Not started

  11. Not started

  12. Not started

  13. Not started

Challenge 1.3

Display Binary Numbers (using variables as an operator)

Challenge Level: Beginner

Requirement:

Write a program to display numbers 1, 2, 4, 8 and 16 on the screen one at a time. This is similar to the previous challenge, but instead of storing a number directly into the variable, you should double the value in the variable each time. You need to use an operator (for multiplying 2 numbers) for this challenge.

Hints
  • Make a variable called “number of dots” and change its value by using an operator (multiplying it by 2 before displaying it on the screen each time). You can find Create variable” under the "Variables" category to create a new variable. Make sure your variable name is as descriptive as possible.
  • Use the 'Set variable to' block to set the value of your new variable. Use the 'Multiply' block under “Operators” to double the value of your variable.
  • Display the value of your variable on the screen by putting your new variable block in the 'Say' block.
Programming Reminders

Output statements

Output a string directly
Blocks showing how to output a string
Output a variable
Blocks showing how to output a variable

Variables

Set a variable as a string
Blocks showing how to set a variable as a string
Set a variable as an integer
Blocks showing how to set a variable as an integer
Set a variable from a calculation
Blocks showing how to set a variable from a calculation
Set a variable from a user input (text)
Blocks showing how to set a variable from a user input (text)
Set a variable from a user input (number)
Blocks showing how to set a variable from a user input (number)
Add one to a value
Blocks showing how to add one to a value

Conditionals

Find out the discount on fruit
Blocks showing how to use conditional blocks

Loops

Output string 10 times
Blocks showing how to output a string
Output number until number reaches 10
Blocks showing how to output a string
Recommended Blocks
Number block
Say block
Multiply block
Set variable to block
Custom variable block

Create your program in the editor below

Your submission results will be displayed here

Input Expected output Received output Status

                
1
2
4
8
16

                
Not yet run ?