CERTIFICATE IN INFORMATION TECHNOLOGY (NTA)
Principles of Programming
& Basic Computing Mathematics
Core Concepts Study Summary
Prepared for exam revision — NACTE / NTA framework
Contents
PART A — Principles of Programming
1. What is Programming? Key Concepts
2. Problem-Solving Tools: Algorithms, Flowcharts, Pseudocode
3. Programming Language Levels & Translators
4. Data Types, Variables & Constants
5. Operators & Expressions
6. Control Structures (Sequence, Selection, Iteration)
7. Arrays and Data Structures Basics
8. Functions / Modular Programming
9. Program Development Life Cycle & Error Types
PART B — Basic Computing Mathematics
1. Number Systems
2. Number Base Conversion
3. Binary Arithmetic
4. Data Representation (Bits, Bytes, ASCII)
5. Boolean Algebra & Logic Gates
6. Set Theory Basics
7. Basic Statistics for Computing
8. Sequences, Series & Basic Matrices
Quick Revision Checklist
Programming & Computing Mathematics — NTA Certificate in IT
PART A — PRINCIPLES OF PROGRAMMING
1. What is Programming? Key Concepts
Programming is the process of designing and writing a set of instructions (a program) that tells a computer
exactly what to do to solve a problem. A programmer must think logically and break a large problem into
small, precise steps a computer can execute.
• Program: a sequence of instructions written in a programming language.
• Programmer: the person who writes, tests and maintains programs.
• Software: a general term for programs and the data they use (system software vs application
software).
• Logic: the correct order and reasoning behind the steps of a solution — this matters more than the
language used.
2. Problem-Solving Tools
a) Algorithm
A step-by-step, ordered set of instructions written in plain language (or numbered steps) that solves a
specific problem in a finite number of steps. A good algorithm is clear, finite, unambiguous, and produces the
correct output for valid input.
Example — algorithm to find the largest of two numbers:
• Step 1: Start
• Step 2: Input A and B
• Step 3: If A > B then Largest = A, otherwise Largest = B
• Step 4: Print Largest
• Step 5: Stop
b) Flowchart
A diagram that shows the steps of an algorithm using standard symbols connected by arrows that indicate
the flow of control.
Symbol Name Meaning
Oval Terminal Start / Stop of the program
Parallelogram Input/Output Data entry or display of results
Rectangle Process An action or calculation
Diamond Decision A yes/no or true/false condition (branch point)
Arrow Flow line Shows the direction of execution
Circle Connector Joins parts of a flowchart on the same or another page
c) Pseudocode
An informal, English-like way of writing an algorithm using programming-style keywords (START, INPUT,
IF...THEN...ELSE, WHILE, END) without following the strict syntax of any real language. It bridges the gap
between an algorithm and actual code.
3. Programming Language Levels & Translators
Page 3
Programming & Computing Mathematics — NTA Certificate in IT
Level Description Examples
Machine language Lowest level; binary code (0s and 1s) executed directly 10110000 01100001
by the CPU
Assembly language Uses mnemonic codes (short symbols) that map to MOV, ADD, JMP
machine instructions
High-level language Close to human language; easier to write, read and Python, C, Java, Pascal
maintain
Language translators convert source code into machine code:
• Compiler: translates the whole source program into machine code at once, producing an executable
file.
• Interpreter: translates and executes the program line by line, without producing a saved executable.
• Assembler: translates assembly language into machine code.
Page 4
Programming & Computing Mathematics — NTA Certificate in IT
4. Data Types, Variables & Constants
Variable: a named storage location whose value can change during program execution. Constant: a named
storage location whose value cannot change once set.
Data type Holds Example
Integer (int) Whole numbers, positive or negative 10, -5, 2026
Float / Real Numbers with decimal points 3.14, -0.5
Character (char) A single letter, digit or symbol 'A', '7', '$'
String A sequence of characters (text) "Mwanza"
Boolean Logical value: True or False only True, False
Naming rules for variables (general convention):
• Must begin with a letter (or underscore), not a digit.
• No spaces or special characters (use camelCase or underscores, e.g. studentAge, total_marks).
• Should be descriptive of what the variable stores.
• Cannot be a reserved keyword of the language (e.g. if, while, int).
5. Operators & Expressions
Category Operators Purpose
Arithmetic + - * / % (mod) ^ (power) Perform calculations
Relational = == < > <= >= != Compare two values; result is True/False
Logical AND OR NOT Combine or invert conditions
Assignment = += -= *= /= Assign or update a variable's value
Order of operations (precedence) — evaluated in this order: (1) Brackets, (2) Exponents/Powers, (3)
Multiplication & Division, (4) Addition & Subtraction (remember BODMAS/PEMDAS). Relational operators
are evaluated after arithmetic ones, and logical operators (AND/OR/NOT) last.
6. Control Structures
Every program is built from three basic control structures that determine the order in which instructions run:
a) Sequence
Instructions execute one after another, in the exact order written — the default flow.
b) Selection (branching / decision)
Chooses between alternative paths based on a condition:
• IF...THEN — runs a block only if a condition is true.
• IF...THEN...ELSE — runs one block if true, another if false.
• IF...ELSE IF...ELSE (nested) — tests multiple conditions in order.
• SWITCH / CASE — selects one of many blocks based on the value of a variable.
c) Iteration (looping / repetition)
Repeats a block of instructions while/until a condition is met:
• FOR loop — repeats a fixed, known number of times (uses a counter).
• WHILE loop — repeats while a condition remains true; checked before each pass (may run zero times).
• DO...WHILE / REPEAT...UNTIL loop — condition checked after each pass, so the body always runs at
least once.
Page 5
Programming & Computing Mathematics — NTA Certificate in IT
7. Arrays and Data Structures Basics
An array is a single variable name used to store a fixed-size, ordered collection of values of the same data
type, accessed using an index (position number, usually starting at 0).
• One-dimensional array: a simple list, e.g. marks[0], marks[1], marks[2] ...
• Two-dimensional array: a table/grid of rows and columns, e.g. grid[row][col].
• Index/Subscript: the position number used to access a specific element.
• Arrays are useful for storing many related values under one name instead of many separate variables.
8. Functions / Modular Programming
Modular programming breaks a large program into smaller, manageable, reusable blocks called functions
(or procedures/subroutines), each performing one specific task.
• Function definition: where the block of code and its logic is written.
• Function call: the statement that runs the function from elsewhere in the program.
• Parameter/Argument: a value passed into a function for it to use.
• Return value: the result a function sends back to where it was called.
• Benefits: easier debugging, code reuse, teamwork on large projects, improved readability.
9. Program Development Life Cycle & Error Types
• 1. Problem definition/analysis: understand exactly what the program must do.
• 2. Design: plan the solution using algorithms, pseudocode or flowcharts.
• 3. Coding: translate the design into a chosen programming language.
• 4. Testing & debugging: run the program with test data to find and fix errors.
• 5. Documentation: record how the program works, for users and future maintainers.
• 6. Maintenance: update the program over time to fix issues or add features.
Types of programming errors:
Error type Description
Syntax error Breaks the grammar rules of the language (e.g. missing bracket); caught before running.
Logical error Program runs but produces the wrong result, due to a flaw in the reasoning/algorithm.
Runtime error Occurs while the program is executing, e.g. division by zero, causing a crash.
Page 6
Programming & Computing Mathematics — NTA Certificate in IT
PART B — BASIC COMPUTING MATHEMATICS
1. Number Systems
A number system is a way of representing numbers using a set of symbols (digits) and a base (radix) — the
count of digits available. Computers work internally with binary.
System Base Digits used Typical use
Binary 2 0, 1 Internal computer representation (bits)
Octal 8 0–7 Compact grouping of binary (3 bits per digit)
Decimal 10 0–9 Everyday human counting
Hexadecimal 16 0–9, A–F Memory addresses, colour codes, compact
binary (4 bits/digit)
2. Number Base Conversion
Decimal → Binary: divide repeatedly by 2, record remainders, read them bottom-to-top.
Example: 25 in decimal → 25÷2=12 r1, 12÷2=6 r0, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → read remainders
bottom-to-top: 11001■
Binary → Decimal: multiply each digit by its place value (power of 2) and sum.
Example: 1101■ = (1×2³)+(1×2²)+(0×2¹)+(1×2■) = 8+4+0+1 = 13■■
Decimal ↔ Octal / Hexadecimal: same repeated-division method, dividing by 8 or 16; remainders 10–15 in
hex are written A–F.
Binary ↔ Octal: group binary digits in sets of 3 (from the right); each group = one octal digit.
Binary ↔ Hexadecimal: group binary digits in sets of 4 (from the right); each group = one hex digit.
Example: 1011 0110■ → groups of 4: 1011=B, 0110=6 → B6■■
3. Binary Arithmetic
Binary addition rules:
• 0+0=0
• 0+1=1
• 1 + 1 = 10 (write 0, carry 1)
• 1 + 1 + 1 (carry) = 11 (write 1, carry 1)
Example: 1011 + 0110: add column by column with carries → result = 10001■
Binary subtraction: follows borrow rules similar to decimal subtraction (0 − 1 borrows from the next
column). Binary multiplication: works like normal long multiplication but only using 0s and 1s (0×0=0,
0×1=0, 1×1=1).
4. Data Representation (Bits, Bytes, ASCII)
• Bit (binary digit): the smallest unit of data — a single 0 or 1.
• Byte: a group of 8 bits; commonly used to represent one character.
• Nibble: half a byte, 4 bits.
• Storage units: 1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB, 1 TB = 1024 GB.
Page 7
Programming & Computing Mathematics — NTA Certificate in IT
• ASCII (American Standard Code for Information Interchange): a standard code assigning a unique
numeric value (0–127) to each letter, digit and symbol so computers can represent text in binary, e.g.
capital 'A' = 65 = 01000001■.
5. Boolean Algebra & Logic Gates
Boolean algebra deals with variables that can only hold two values: True/False or 1/0. It is the mathematical
foundation of digital logic circuits and decision-making in programs.
Gate Symbolic notation Rule Output is 1 (True) when
AND A · B (A AND B) Output = 1 only if all inputs = 1 Both A=1 and B=1
OR A + B (A OR B) Output = 1 if at least one input = 1 A=1 or B=1 (or both)
NOT A' (NOT A) Reverses (inverts) the input Input A = 0
NAND (A · B)' Opposite of AND Not (A=1 and B=1)
NOR (A + B)' Opposite of OR Both A=0 and B=0
XOR A⊕B Output = 1 only if inputs differ A and B have different values
Sample truth table — AND gate:
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
Sample truth table — OR gate:
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
Page 8
Programming & Computing Mathematics — NTA Certificate in IT
6. Set Theory Basics
A set is a well-defined collection of distinct objects called elements/members, usually written inside curly
brackets, e.g. A = {1, 2, 3, 4}.
• Union (A ∪ B): all elements that are in A, in B, or in both.
• Intersection (A ∩ B): only the elements common to both A and B.
• Complement (A'): all elements in the universal set that are NOT in A.
• Difference (A − B): elements that are in A but not in B.
• Subset (A ⊆ B): every element of A is also an element of B.
• Empty/Null set (∅ or { }): a set containing no elements.
• Cardinality |A|: the number of elements in set A.
7. Basic Statistics for Computing
Statistics is used in computing for data analysis, reporting and decision support. Key measures of central
tendency:
Measure Meaning How to find it
Mean The average value Sum of all values ÷ number of values
Median The middle value Arrange values in order; pick the middle one (or average the
two middle values)
Mode The most frequent value The value(s) that appear most often in the data set
Range Spread of the data Highest value − Lowest value
Example: Data set {4, 8, 6, 5, 8, 9} → Mean = (4+8+6+5+8+9)/6 = 6.67; sorted = {4,5,6,8,8,9} → Median =
(6+8)/2 = 7; Mode = 8 (appears twice).
8. Sequences, Series & Basic Matrices
Sequence: an ordered list of numbers following a rule, e.g. 2, 4, 6, 8 (arithmetic, common difference +2) or
2, 4, 8, 16 (geometric, common ratio ×2).
Series: the sum of the terms of a sequence, e.g. 2+4+6+8 = 20.
Matrix: a rectangular array of numbers arranged in rows and columns, written as (rows × columns), used in
computing for organising and transforming data (e.g. images, graphics, tables).
Example — a 2×2 matrix:
3 5
2 7
Matrices of the same size are added/subtracted element by element; matrix multiplication follows the
row-by-column rule (covered in more depth at higher levels).
Page 9
Programming & Computing Mathematics — NTA Certificate in IT
Quick Revision Checklist
Before your exam, make sure you can confidently:
• Write and trace a simple algorithm and draw its flowchart.
• Convert pseudocode into a program outline and vice versa.
• Explain compiler vs interpreter vs assembler.
• Declare variables/constants and pick the correct data type for a value.
• Evaluate an expression using correct operator precedence.
• Identify and write examples of sequence, selection and iteration structures.
• Explain arrays with index positions and give a real example.
• Explain why functions/modular programming are used.
• List the stages of the program development life cycle and the 3 error types.
• Convert numbers between binary, octal, decimal and hexadecimal by hand.
• Add two binary numbers, including carries.
• Explain bit, byte and ASCII, and calculate simple storage conversions (KB/MB/GB).
• Draw truth tables for AND, OR, NOT, NAND, NOR, XOR.
• Apply set operations (union, intersection, complement, difference).
• Calculate mean, median, mode and range from a small data set.
• Identify arithmetic vs geometric sequences and compute a simple series sum.
Study tip: work through each worked example by hand before checking the answer, and practice drawing flowcharts
and truth tables freehand — these are common exam question formats at Certificate/NTA level. Good luck, Faraja!
Page 10