Unit #2-02

Learning Outcome

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

  • start to understand what a variable is used for

Review

  • go over what is programming
    • just a set of instructions
  • go over Micro:bit javascript programming

Lesson

  • 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

Activity

Daily Assignment

  • write a program that adds 1 each time you click the "A" button, and then shows the total
    • when you click the "B" button it adds 5 to your total
    • when you shake the Micro:bit, it returns the variable to 0
  • upload a screen shot showing your code and the program running

Extra

    • if you finish early, work on Tynker