What is a variable Pro Preview

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1283
  • 17 May 2019

Variables are little boxes within the computer, that store some important for us information. Imagine the following situation: you own a bar which offers the best lemonade in town. The lemonade is stored in a small non-transparent barrel, so one can not see how much lemonade there is inside. It is important that you always have fresh lemonade - if the lemonade finish before the next delivery, you will not have lemonade and your customers will be unsatisfied, if you order too early you risk that the lemonade would not be fresh and the customers will not be satisfied again. So the solution is to take a white piece of paper, which will be your variable, and put down to amount of lemonade you have. When a customer order a lemonade, you subtract his order and put down the new amount of lemonade. You repeat that process until you are left with lets say 10 liters of lemonade, when you order a new barrel.

As mentioned in the above situation, the white piece of paper is a variable. It stores a valuable for us information i.e... the amount of lemonade inside the barrel. If we need to program this operation we will have to read the number written on the paper (or in the variable) subtract the amount we have sold and write down on the paper (or in the variable) the new amount. We do not know those values before hand, but they does not matter. We will repeat the same action until the variable has value less or equal to 10.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Robotics with LEGO - Level 3.5 - Measuring tools
  • 58
  • 0:00
  • 185
Image for Lesson 5 - Piggy bank. Counting money
  • 7
  • 5
  • 2
  • 3d_rotation 1
Image for Instructors Remote Training
  • 136
  • 280:11
  • 156
Image for Robotics with LEGO - Level 4.0 - Kinesthetic and Memory Game (in development)
  • 59
  • 2:58
  • 200
Image for Python with LEGO Mindstorms EV3 - Level 1
  • 74
  • 28:18
  • 114
Image for Lesson 4 - Strange Bot
  • 7
  • 5
  • 11
  • 3d_rotation 1