Section outline

    • 💾 What is a Variable?

      A variable is like a storage box in your robot’s brain.

      It remembers important values – like a number, name, or signal – while the robot is working.

      Think of it as:

      📦 Label: score → Inside: 0

      📦 Label: speed → Inside: 5

      Variables help the robot keep track of things.


      🧃 Real-Life Analogy

      Imagine you’re running a lemonade stall.

      You use:

      • A jar to store money collected

      • A notepad to track cups sold

      Both are like variables — holding and updating values as things change.

    • 🤖 How Robots Use Variables

      Here’s what robots might store using variables:

      • Temperature from a sensor

      • Battery level

      • How many steps walked

      • Whether a switch is ON or OFF (true/false)

      For example:

      battery = 80 If battery < 20 → Show “Low Battery”

      The robot remembers and compares the value when needed.


      🏏 Sports Analogy (for global students)

      During a cricket match:

      • runs = 0

      • Every time a run is scored → runs = runs + 1

      The scoreboard is like a robot’s variable – it keeps updating based on events!


      🧠 Common Types of Variables

      1. Numbers (like 5, 100) → for speed, time, distance

      2. Text (like "Hello") → for names or messages

      3. True/False (also called Boolean) → for yes/no or on/off


      🎯 Quick Robot Example

      A robot vacuum can store:

      • dirtLevel = 3

      • areaCleaned = 25 (in square meters)

      • needsRecharge = false

      Based on these, it makes smart decisions like:

       

      If areaCleaned > 50 → Go to charging dock

    • 🛠️ Hands-On Activity

      Try thinking of a robot that feeds pets.

      What variables might it need?
      • Time of last feeding

      • Amount of food left

      • Pet weight

      Can you write these down as variable names?

      🌟 Key Takeaway

      Variables give robots memory and awareness.

      Without them, robots would forget everything and start from scratch each time!