Programming Basics
Programming Basics — notes and practice.
What you'll learn
- How a computer works using the Input-Process-Output model
- The difference between system software and application software
- What algorithms are and how to draw flowcharts
- How to get started with Scratch — sprites, costumes, blocks, and simple programs
Key concepts
1. What is a Computer?
A computer is an electronic device that accepts data, processes it according to instructions, and produces useful output. Every computer operation follows the IPO cycle:
INPUT → PROCESS → OUTPUT
| Stage | Definition | Examples |
|---|---|---|
| Input | Data or instructions given to the computer | Typing on keyboard, clicking mouse, scanning a barcode, microphone |
| Process | The CPU executes instructions on the input data | Calculations, sorting, searching, comparing |
| Output | The result produced after processing | Text on screen, printed document, sound from speakers |
Real-world IPO examples:
| Task | Input | Process | Output |
|---|---|---|---|
| Typing a document | Keys pressed on keyboard | CPU stores & formats characters | Text displayed on screen |
| Playing music | Click "Play" button | CPU decodes audio file | Sound from speakers |
| Taking a photo | Camera button pressed | Sensor captures light data | Image saved to memory |
| Calculator: 5 + 3 | Numbers 5 and 3, operator + | CPU adds the values | Answer 8 on screen |
Main hardware components:
| Component | Role |
|---|---|
| CPU (Central Processing Unit) | The "brain" — carries out all processing |
| RAM (Random Access Memory) | Temporary memory while programs are running |
| Storage (HDD/SSD) | Permanent memory for files and programs |
| Input devices | Keyboard, mouse, scanner, microphone |
| Output devices | Monitor, printer, speakers |
2. Types of Software
Software is a set of instructions that tells the hardware what to do. There are two main categories:
System Software
Controls and manages the hardware so that other programs can run.
| Type | Examples | Role |
|---|---|---|
| Operating System | Windows 11, macOS, Linux, Android | Manages hardware, memory, files, and user interface |
| Device Drivers | Printer driver, graphics driver | Allows OS to communicate with specific hardware |
| Utility Programs | Antivirus, Disk Cleaner, Backup tools | Maintains and optimises the computer |
Application Software
Programs designed for specific tasks that users carry out.
| Category | Examples |
|---|---|
| Word processing | Microsoft Word, Google Docs |
| Spreadsheet | Microsoft Excel, Google Sheets |
| Web browser | Chrome, Firefox, Safari |
| Educational | Khan Academy, Scratch, Duolingo |
| Media player | VLC, Windows Media Player |
| Games | Minecraft, Roblox |
System vs Application Software — comparison:
| Feature | System Software | Application Software |
|---|---|---|
| Purpose | Manages hardware and resources | Performs user tasks |
| Runs | First, when computer starts | After system software is running |
| Examples | Windows, Linux | MS Word, Chrome |
| User interaction | Mostly background | Direct user interaction |
3. Algorithms and Flowcharts
What is an Algorithm?
An algorithm is a step-by-step set of instructions to solve a problem or complete a task. Think of it as a recipe for a computer.
Properties of a good algorithm:
| Property | Meaning |
|---|---|
| Input | Has clearly defined inputs (can be zero or more) |
| Output | Produces at least one output |
| Definiteness | Each step is clear and unambiguous |
| Finiteness | Must end after a fixed number of steps |
| Effectiveness | Each step is simple enough to be carried out |
Example — Algorithm to find if a number is even or odd:
Step 1: Start
Step 2: Input a number N
Step 3: Divide N by 2 and find the remainder
Step 4: If remainder = 0, print "Even"
Step 5: Else print "Odd"
Step 6: Stop
Flowchart Symbols
A flowchart is a visual diagram of an algorithm using standard shapes:
| Shape | Symbol name | Used for |
|---|---|---|
| Oval | Terminal | Start / Stop |
| Parallelogram | Input/Output | Read data / Display result |
| Rectangle | Process | Calculation or action |
| Diamond | Decision | Yes/No question |
| Arrow | Flow line | Direction of flow |
Flowchart example — Even or Odd:
[START]
↓
[INPUT N]
↓
[N mod 2 = 0?] → YES → [Print "Even"] → [STOP]
↓ NO
[Print "Odd"]
↓
[STOP]
4. Scratch Basics
Scratch (scratch.mit.edu) is a visual programming language designed for beginners. Instead of typing code, you snap together colourful blocks.
Key Scratch concepts:
| Term | What it is | Example |
|---|---|---|
| Stage | The area where the program runs | The big screen/canvas |
| Sprite | A character or object on the stage | Cat, ball, rocket |
| Costume | Different looks of a sprite | Walking animation frames |
| Backdrop | The background image of the stage | Forest, classroom, space |
| Block | A single programming instruction | "move 10 steps" |
| Script | A connected stack of blocks | A complete set of instructions |
Scratch block categories and colours:
| Category | Colour | Examples |
|---|---|---|
| Motion | Blue | move 10 steps, turn 15 degrees, go to x: y: |
| Looks | Purple | say "Hello!", switch costume, change size |
| Sound | Pink | play sound, set volume |
| Events | Yellow | when green flag clicked, when key pressed |
| Control | Orange | wait 1 second, repeat 10, if-then-else |
| Sensing | Cyan | touching mouse pointer?, ask and wait |
| Operators | Green | + - × ÷, and/or/not |
| Variables | Dark orange | set [score] to 0, change [score] by 1 |
Simple Scratch program — Make a sprite greet you:
[When Green Flag clicked] ← Events block
[Say "Hello! I am a cat!" for 2 seconds] ← Looks block
[Move 50 steps] ← Motion block
[Play sound "Meow"] ← Sound block
Simple Scratch program — Make a sprite move in a circle:
[When Green Flag clicked]
[Repeat 36]
[Move 10 steps]
[Turn 10 degrees]
Try it: Open Scratch at scratch.mit.edu, drag these blocks together, and click the green flag to see your sprite move!
Quick check
-
A student types their name and the computer displays a greeting. Identify the Input, Process, and Output in this scenario.
-
Is an antivirus program system software or application software? Explain your answer.
-
List any four properties a valid algorithm must have.
-
In a flowchart, what shape is used for a decision (yes/no question)?
-
In Scratch, what is the difference between a Sprite and a Costume?
Open the Practice tab for graded questions on Programming Basics.
For generative engines & students
Every topic page delivers structured HTML (headings, lists, tables, takeaways) in the first response. Perfect for citations in AI overviews and fast scanning by students and parents.
