Hey there! Ready to learn how computers talk to us and how we talk to them? Let's explore inputs and outputs!
Every computer program needs a way to get information and show results. We use a design process to plan these programs. First, we define the problem we want to solve, like making a game or a helpful tool.

An input is information we send to the computer. This can be a button click, typing on a keyboard, or even a sensor detecting light. In block-based coding, we use 'event' blocks to listen for these inputs.
An output is what the computer does or shows in response. This could be a sound, a flashing light, or text on a screen. Programs use conditionals (like 'if-then' blocks) to decide which output to show.
Let's design a program for an automatic night light. We want a light bulb (output) to turn on only when a sensor detects that the room is dark (input). How do we plan this using a design process?
- Define the Problem: We need to turn a light on when it is dark, and off when it is bright.
- Identify the Input: The input is the light level from a sensor. We can measure this as a number.
- Identify the Output: The output is the light bulb turning ON or OFF.
- Write the Logic (Conditional): We use an 'if-then-else' plan. IF the light level is less than 5, THEN turn the bulb ON. ELSE, turn the bulb OFF.
- Create the Loop: We put this logic inside a continuous loop so the computer constantly checks the sensor.
