Lesson Notes By Weeks and Term v5 - Grade 12

Revision and examination preparation (Grade 12 IT) – Week 8 focus

Download the Lessonotes Mobile South Africa app for faster lesson access on Android and iPhone.

Subject: Information Technology

Class: Grade 12

Term: Term 4

Week: 8

Theme: General lesson support

Lesson Video

This page supports the lesson note with a companion video and a short classroom-ready summary.

For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.

Performance objectives

Lesson summary

This week focuses on solidifying your understanding of key concepts across the Grade 12 IT curriculum and equipping you with the necessary skills for examination success. Examination preparation is not just about memorizing facts; it's about understanding the interconnectedness of different IT concepts and applying them to solve problems. In South Africa, IT skills are crucial for driving economic growth and addressing societal challenges. Whether it's developing mobile applications for healthcare access in rural communities, designing e-commerce platforms for local businesses, or analyzing data to improve agricultural practices, a strong IT foundation is essential.

Lesson notes

This week's revision will cover Sorting Algorithms, Object-Oriented Programming (OOP), Database Normalization, Debugging Techniques, and Emerging Technologies. a)

Sorting Algorithms: Sorting algorithms arrange elements in a list or array in a specific order (ascending or descending). The efficiency of a sorting algorithm is measured by its time complexity (how the execution time grows with the input size) and space complexity (how much extra memory it requires).

Bubble Sort: Compares adjacent elements and swaps them if they are in the wrong order. Simple to understand but inefficient for large datasets.

Time Complexity: O(n^2) in the average and worst cases.

Example: Consider the array `[5, 1, 4, 2, 8]`. Bubble Sort would repeatedly iterate, comparing and swapping: `[1, 5, 4, 2, 8]` (5 and 1 swapped) `[1, 4, 5, 2, 8]` (5 and 4 swapped) `[1, 4, 2, 5, 8]` (5 and 2 swapped) `[1, 4, 2, 5, 8]` (5 and 8 - no swap) This process repeats until the array is sorted.

Insertion Sort: Builds a sorted sub-array by inserting elements one by one into their correct position. Efficient for small datasets or nearly sorted data.

Time Complexity: O(n^2) in the average and worst cases.

Example: Consider the array `[5, 1, 4, 2, 8]`.

Insertion Sort would: Start with `[5]`. Insert `1` into its correct place: `[1, 5]`. Insert `4` into its correct place: `[1, 4, 5]`. Insert `2` into its correct place: `[1, 2, 4, 5]`. Insert `8` into its correct place: `[1, 2, 4, 5, 8]`.

Merge Sort: Divides the array into smaller sub-arrays, recursively sorts them, and then merges them back together. Efficient and has a guaranteed time complexity.

Time Complexity: O(n log n) in all cases.

Example: Consider the array `[5, 1, 4, 2, 8]`.

Merge Sort would: Divide: `[5, 1]`, `[4, 2, 8]` Divide further: `[5]`, `[1]`, `[4]`, `[2]`, `[8]` Merge (and sort): `[1, 5]`, `[2, 4]`, `[8]` Merge (and sort): `[1, 5]`, `[2, 4, 8]` Merge (and sort): `[1, 2, 4, 5, 8]` b)

Object-Oriented Programming (OOP): OOP is a programming paradigm based on the concept of "objects," which contain data (attributes) and code (methods) to manipulate that data.

Classes: Blueprints for creating objects. Define the attributes and methods that objects of that class will have.

Example (Delphi): ```delphi type TStudent = class private FName: string; FSurname: string; FAge: Integer; public constructor Create(Name, Surname: string; Age: Integer); function GetFullName: string; procedure DisplayDetails; end; constructor TStudent.Create(Name, Surname: string; Age: Integer); begin FName := Name; FSurname := Surname; FAge := Age; end; function TStudent.GetFullName: string; begin Result := FName + ' ' + FSurname; end; procedure TStudent.DisplayDetails; begin ShowMessage('Name: ' + GetFullName + #13 + 'Age: ' + IntToStr(FAge)); end; ``` Objects: Instances of a class. Created using the class as a template.

Example (Delphi): ```delphi var Student1: TStudent; begin Student1 := TStudent.Create('Thabo', 'Mbeki', 18); Student1.DisplayDetails; // Displays the student's details end; ``` Inheritance: Allows a class (subclass/child class) to inherit properties and methods from another class (superclass/parent class). Promotes code reusability.

Polymorphism: Allows objects of different classes to be treated as objects of a common type. Achieved through method overriding and interfaces.

Encapsulation: Bundling data and methods that operate on that data within a class. Protects data from unauthorized access and modification. c)

Database Normalization: A process of organizing data in a database to reduce redundancy and improve data integrity. Normal forms (1NF, 2NF, 3NF) define rules for structuring tables. 1NF (First Normal Form): Each column should contain atomic values (indivisible). No repeating groups of columns. 2NF (Second Normal Form): Must be in 1NF and all non-key attributes must be fully functionally dependent on the entire primary key. Applies to tables with composite primary keys. 3NF (Third Normal Form): Must be in 2NF and all non-key attributes must be non-transitively dependent on the primary key. No non-key attribute should depend on another non-key attribute.

Example: Consider a table "Orders" with columns: `OrderID`, `CustomerID`, `CustomerName`, `CustomerAddress`, `OrderDate`.

Problem: `CustomerName` and `CustomerAddress` are dependent on `CustomerID`, not directly on `OrderID`.

Solution: Create two tables: `Orders` (`OrderID`, `CustomerID`, `OrderDate`) and `Customers` (`CustomerID`, `CustomerName`, `CustomerAddress`). This eliminates redundancy and ensures data consistency. d)

Debugging Techniques: The process of finding and fixing errors in code.

Read Error Messages Carefully: Understand the type and location of the error.

Use a Debugger: Step through the code line by line, inspect variable values, and identify the source of the error.