Grade 11 Information Technology · Lesson 6.5
Writing a Simple Program
Unit 6: Fundamentals of Programming
Writing a program follows a problem-solving process often called the program development life cycle. First, understand and analyse the problem: what are the inputs, what processing is needed, and what output is expected? Second, design a solution as an algorithm, a clear step-by-step procedure, written as pseudocode or drawn as a flowchart. Third, code the algorithm in a programming language. Fourth, test the program with different data, including unusual values. Fifth, debug (find and fix errors), and finally document and maintain the program.
Key terms
- Algorithm
- step-by-step procedure to solve a problem
- Pseudocode
- algorithm written in structured plain language
- Flowchart
- diagram of an algorithm using standard symbols
- IPO chart
- table of inputs, processes and outputs
- Selection
- choosing a path with if/elif/else
- Loop
- structure that repeats statements
- Debugging
- finding and fixing errors
- Logic error
- error that gives a wrong result without crashing
Summary
- Analyse the problem, design an algorithm, code, test, debug and document.
- Use IPO charts, pseudocode and flowcharts to plan.
- Programs combine sequence, selection and repetition.
- Errors may be syntax, runtime or logic; test with known answers.
In everyday life: A small kiosk owner could use a simple Python program to total daily sales in Birr and warn when stock of an item falls below a set level.
Check yourself
- List the stages of program development.
- What does a diamond represent in a flowchart?
- Give an example of a logic error.
- What does range(1, 6) produce?
Practice questions
1. A program runs: price = 40; qty = 3; total = price * qty + 10; print(total). What is printed?
Show answer
Answer: 130
Multiplication is done first: 40 * 3 = 120, then 120 + 10 = 130.
On WeLearn
The full lesson: reading notes, worked examples, class activities and the Unit 6 quiz
Study Writing a Simple Program on WeLearnTeach Writing a Simple Program with WeLearn
We will bring a demo to your school: a lesson on your interactive TV, a virtual lab and a classroom game, with your own teachers.
