🤖 How Robots Use Variables
Here’s what robots might store using variables:
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:
The scoreboard is like a robot’s variable – it keeps updating based on events!
🧠 Common Types of Variables
-
Numbers (like 5, 100) → for speed, time, distance
-
Text (like "Hello") → for names or messages
-
True/False (also called Boolean) → for yes/no or on/off
🎯 Quick Robot Example
A robot vacuum can store:
Based on these, it makes smart decisions like:
If areaCleaned > 50 → Go to charging dock