Unit #2-04

Learning Outcome

At the end of this lesson, you will be able to:

  • continue to understand what a variable is used for

Review

  • a variable is just a place to store information, that can change, hence the name
    • we use them in math all the time
    • in programming, we do not use a single letter to represent a variable, we use a word( or several words) to describe it
      • ex: counter, numberOfStudents, totalCost, ...
    • notice how we spell variable names

Lesson

  • random number
    • why do we start counting at 0?

Activity

  • show demo of "Roll Dice" on Micro:Bit

Daily Assignment

  • create the "Roll the Dice" program
    • you MUST save the random number in a variable
    • see document below

Extra

  • if you finish early:
    • make the same kind of but using Blockly
    • make something else in Blockly