×

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.4

Display Binary Numbers (using a variable, operator and a repeat loop)

Challenge Level: Beginner

Requirement:

Write a program to display numbers 1, 2, 4, 8 and 16 on the screen one at a time. This challenge builds on the previous one, but the program should use a loop, so it could easily be updated to display more numbers.

Hints
  • 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.
  • Use the 'Repeat' block to run the blocks inside a specified number of times. In this challenge you need to repeat the blocks 5 times.
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
Repeat 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 ?