GRADE 10 COMPUTER SCIENCE
STRAND: SOFTWARE DEVELOPMENT
3.1 Computer Programming Concepts
3.1.1 Terminologies Used in Programming
Learners must be comfortable with the vocabulary of programming before writing any code. Key terms:
• Program – a set of instructions written in a programming language that tells a computer what to do.
• Programming – the process of designing, writing, testing and maintaining the instructions (code) that
make up a program.
• Programming language – a formal set of rules (syntax and semantics) used to write instructions a
computer can execute.
• Source code – the human-readable instructions written by the programmer.
• Object code / machine code – the binary instructions produced after translation, which the CPU
executes directly.
• Syntax – the grammar/rules governing how statements in a language must be written.
• Semantics – the meaning of correctly structured statements.
• Bug – an error in a program that causes it to behave incorrectly.
• Debugging – the process of finding and correcting bugs.
• Compiler – a translator that converts the whole source code into machine code before execution,
producing an executable file.
• Interpreter – a translator that converts and executes source code line-by-line, without producing a
standalone executable.
• Assembler – translates assembly language (mnemonics) into machine code.
• Algorithm – a finite, ordered set of steps for solving a problem.
• IDE (Integrated Development Environment) – software that bundles a code editor, compiler/interpreter
and debugger, e.g. Visual Studio Code, PyCharm.
Teaching tip: Use an everyday analogy – a recipe is an algorithm, the cookbook language is the
programming language, and the cook following the steps exactly is the computer executing syntax-correct
code.
3.1.2 Evolution of Programming Languages
Programming languages have evolved through five broad generations, each moving further from hardware-
level instructions and closer to human language:
Generation Description Example
1GL – Machine language Binary (0s and 1s) instructions executed directly by the CPU; Pure binary
fastest but extremely hard to write and hardware-dependent. code
2GL – Assembly language Uses mnemonics (ADD, SUB, MOV) instead of binary; needs Assembly
an assembler; still hardware-specific. (x86, ARM)
3GL – High-level languages Closer to human language; machine-independent; needs a C, Python,
compiler/interpreter. Java, BASIC
4GL – Very high-level / declarative Focuses on what should be done rather than how; often used SQL,
for database and report generation. MATLAB
5GL – Natural-language / AI-based Uses constraints and logic; the system determines the steps to Prolog, OPS5
solve the problem (used in AI and expert systems).
General trend: each generation increases programmer productivity and portability, while reducing the need to
understand hardware detail.
3.1.3 Classification of Programming Languages
(a) By level of abstraction
• Low-level languages – machine and assembly languages; close to hardware, fast, but hard to read/write
and not portable.
• High-level languages – human-readable, portable across machines, but need translation
(compiling/interpreting).
(b) By translation method
• Compiled languages – e.g. C, C++; translated fully before running; errors reported after compilation;
fast execution.
• Interpreted languages – e.g. Python, JavaScript; translated and run line by line; easier to debug;
generally slower.
(c) By programming paradigm
• Procedural/imperative – code organised as a sequence of procedures/functions, e.g. C, Pascal.
• Object-oriented – code organised around objects that bundle data and behaviour, e.g. Java, C++,
Python.
• Functional – computation expressed as evaluation of functions, e.g. Haskell, parts of Python/JavaScript.
• Declarative/logic – states what result is wanted, not how to get it, e.g. SQL, Prolog.
(d) By purpose
• General-purpose (Python, Java) vs. domain-specific (HTML for web markup, SQL for databases).
3.1.4 Embracing Evolutionary Trends in Programming
Modern programming is shaped by trends learners should be aware of:
• Cloud-based development and collaborative coding platforms (e.g. GitHub, Replit).
• Low-code/no-code platforms that let non-programmers build applications visually.
• Artificial Intelligence-assisted coding (AI code completion and generation tools).
• Mobile-first and cross-platform development frameworks (Flutter, React Native).
• Open-source development and community-driven language growth (Python, JavaScript ecosystems).
• Growing emphasis on cybersecurity-aware coding practices.
Discussion point: Ask learners to identify one trend they have encountered (e.g. using ChatGPT/Copilot
for code suggestions) and discuss its benefits and risks.
3.2 Overview of Program Development
3.2.1 Program Development Life Cycle (PDLC)
A structured process followed when creating a program:
• 1. Problem definition – clearly state what the program must do.
• 2. Analysis – identify inputs, processes and outputs (IPO).
• 3. Design – plan the solution using algorithms, flowcharts or pseudocode.
• 4. Coding – translate the design into a programming language.
• 5. Testing and debugging – run the program with test data to detect and fix errors.
• 6. Documentation – record how the program works, for users and future developers.
• 7. Implementation/maintenance – deploy the program and update it as required.
Memory aid: PADCTDI – Problem, Analysis, Design, Coding, Testing, Documentation, Implementation.
3.2.2 Representing Logical Flows of an Algorithm
Algorithms can be represented in several ways before coding:
• Pseudocode – plain, structured English-like statements describing steps (e.g. START, INPUT,
IF...THEN, WHILE, END).
• Flowcharts – diagrams using standard symbols to show the sequence of steps:
– Oval – Start/End (terminal symbol)
– Parallelogram – Input/Output
– Rectangle – Process/calculation
– Diamond – Decision (Yes/No branch)
– Arrows – flow direction
• Decision tables – tabular representation of conditions and corresponding actions, useful for complex
decision logic.
START INPUT length, width area ← length * width OUTPUT area END
3.2.3 Designing Algorithms
Good algorithm design follows key properties: finiteness (must end), definiteness (each step is clear),
input/output, and effectiveness (steps must be doable).
Steps for designing an algorithm to solve a problem:
• Understand the problem and identify required inputs and expected outputs.
• Break the problem into smaller logical steps (stepwise refinement).
• Sequence the steps in the correct order.
• Represent the steps using pseudocode or a flowchart.
• Trace/dry-run the algorithm with sample data to check correctness.
Example – algorithm to find the largest of three numbers:
START INPUT a, b, c IF a > b AND a > c THEN OUTPUT a ELSE IF b > c THEN
OUTPUT b ELSE OUTPUT c END IF END
3.2.4 Importance of Algorithms in Problem Solving
• Provide a clear, logical plan before coding, reducing errors.
• Make it easy to identify the most efficient solution among alternatives.
• Are language-independent, so the same algorithm can be implemented in any programming language.
• Simplify debugging, since logic errors can be traced step by step.
• Support teamwork, as algorithms communicate a solution clearly to other developers.
• Form the foundation for structured and object-oriented programming.
3.3 Identifiers and Operators
3.3.1 Basic Programming Terminologies
• Identifier – a name given to a variable, constant, function or object in a program.
• Variable – a named memory location whose value can change during program execution.
• Constant – a named memory location whose value cannot change once set.
• Data type – classification of data specifying the kind of value a variable can hold (integer, float/real,
character, string, boolean).
• Keyword/reserved word – a word with special meaning in a language that cannot be used as an
identifier (e.g. if, while, int).
• Statement – a single instruction in a program.
• Expression – a combination of values, variables and operators that evaluates to a single value.
Rules for naming identifiers
• Must begin with a letter or underscore, not a digit.
• Can contain letters, digits and underscores only – no spaces or special characters.
• Cannot be a reserved keyword.
• Should be case-sensitive and descriptive of the value stored (e.g. studentAge, not x).
3.3.2 Declaration of Variables and Constants
Declaring a variable/constant reserves memory space and (in many languages) fixes its data type before use.
// Variable declarations INTEGER age REAL height STRING name CHARACTER grade
BOOLEAN isPresent // Constant declaration CONSTANT PI = 3.14159
Assignment gives a value to a declared variable, e.g. age ← 15 or in Python: age = 15.
3.3.3 Using Input and Output Statements
• Input statement – accepts data from the user/keyboard into a variable, e.g. INPUT name, or input() in
Python.
• Output statement – displays results to the user/screen, e.g. OUTPUT total, or print() in Python.
Pseudocode: Python equivalent: INPUT name name =
input("Enter name: ") OUTPUT "Hello ", name print("Hello", name)
3.3.4 Operators and Expressions
Category Operators Example
Arithmetic + – * / % (mod) ^ (exponent) total = price * quantity
Relational/Comparison = ≠ < > ≤ ≥ age >= 18
Logical AND, OR, NOT age >= 18 AND hasID = TRUE
Assignment ← (or =) score ← 0
An expression combines operands (variables/constants) and operators to produce a value, e.g. (length *
width) + margin. The order of evaluation follows operator precedence – brackets first, then exponents, then *
and /, then + and – (BODMAS).
3.3.5 Importance of Identifiers and Operators
• Identifiers give meaningful names to data, making programs readable and self-documenting.
• Consistent naming makes it easier to trace and debug programs.
• Operators allow programs to perform calculations, comparisons and logical decisions – the building
blocks of processing.
• Correct use of both is essential for a program to compile/run and produce correct results.
3.4 Control Structures
3.4.1 Types of Program Control Structures
(a) Sequence
Instructions are executed one after another, in the exact order written, with no branching or repetition.
(b) Selection (decision)
• IF … THEN – executes a block only if a condition is true.
• IF … THEN … ELSE – chooses between two alternative blocks.
• IF … ELSE IF … ELSE (nested) – chooses among several alternatives.
• CASE/SWITCH – selects one of many blocks based on the value of a variable.
IF mark >= 50 THEN OUTPUT "PASS" ELSE OUTPUT "FAIL" END IF
(c) Iteration (looping/repetition)
• FOR loop – repeats a fixed, known number of times (counter-controlled).
• WHILE loop – repeats while a condition remains true; condition tested before each pass (entry-
controlled).
• REPEAT … UNTIL / DO … WHILE – repeats until a condition becomes true; condition tested after
each pass, so it runs at least once (exit-controlled).
FOR i ← 1 TO 5 OUTPUT i ENDFOR WHILE count < 10 count ← count + 1
ENDWHILE
3.4.2 Selecting Control Structures Based on Tasks
Task situation Best control structure
Steps must run in one fixed order, no choices Sequence
A decision with two possible outcomes IF … ELSE
Many possible fixed values to check (e.g. menu choice, grade) CASE/SWITCH
Number of repetitions is known in advance FOR loop
Repetition depends on a condition, may run zero times WHILE loop
Repetition must run at least once before checking REPEAT … UNTIL / DO … WHILE
3.4.3 Using Control Structures to Develop Algorithms
Example – algorithm to classify a student's grade using selection and iteration to process a class list:
START FOR each student IN classList INPUT mark IF mark >= 80 THEN
grade ← "A" ELSE IF mark >= 60 THEN grade ← "B" ELSE IF mark >=
50 THEN grade ← "C" ELSE grade ← "F" END IF OUTPUT
grade ENDFOR END
Learners should be guided to: (1) identify whether the task needs sequence only, a decision, or repetition; (2)
select the matching structure(s); (3) combine structures where needed (e.g. a decision inside a loop, as above);
(4) trace the algorithm with sample data before coding.
3.4.4 Importance of Program Control Structures
• Allow a program to make decisions and respond differently to different data (selection).
• Allow repetitive tasks to be automated instead of writing repeated code (iteration).
• Make programs more efficient, shorter and easier to maintain.
• Enable complex, real-world logic (e.g. grading, validation, menus) to be modelled accurately.
• Form the foundation of structured programming, improving readability and reducing errors.
End of Strand Notes – Software Development (Sections 3.1–3.4)