Lesson Notes By Weeks and Term v5 - Grade 12

Revision and examination preparation (Grade 12 IT) – Week 1 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: 1

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 marks the beginning of our dedicated revision and examination preparation phase for Grade 12 Information Technology. We will be systematically reviewing key concepts and practicing essential skills needed to excel in your final examination. Effective revision is crucial, not just for memorizing facts, but for solidifying your understanding and building confidence. In South Africa's rapidly evolving technological landscape, a strong grasp of IT fundamentals opens doors to countless opportunities, from developing innovative solutions for local challenges to participating in the global tech industry.

Lesson notes

2.1 Data Structures: Organizing Information Data structures are fundamental ways of organizing and storing data in a computer so that it can be used efficiently. Choosing the right data structure for a particular task can significantly impact the performance of your program.

Let's consider three key data structures: arrays, records, and linked lists. 2.1.1 Arrays: An array is a collection of elements of the same data type stored in contiguous memory locations. They are accessed using an index.

Definition (Delphi): `var myArray: array[1..10] of Integer;` This declares an array named `myArray` that can hold 10 integer values, accessible from index 1 to

1

0. Advantages: Simple to implement, efficient access to elements using indices.

Disadvantages: Fixed size (cannot dynamically increase or decrease the number of elements), insertion and deletion can be inefficient (requiring shifting elements).

Example (South African Context): Storing the daily rainfall measurements (in mm) for each day of a month in a specific region of South Africa. Delphi

Example: ```delphi program ArrayExample; var Rainfall: array[1..31] of Real; // Rainfall for each day of the month i: Integer; begin // Assign random rainfall values (replace with actual data) for i := 1 to 31 do begin Rainfall[i] := Random * 10; // Simulate rainfall between 0 and 10 mm end; // Display rainfall for the first week for i := 1 to 7 do begin Writeln('Day ', i, ': ', Rainfall[i]:0:2, ' mm'); end; Readln; // Pause to see the output end. ``` 2.1.2 Records (Structures): A record (or structure) is a collection of related data items of potentially different data types grouped together under a single name.

Definition (Delphi): ```delphi type Student = record StudentID: Integer; Name: string[50]; Surname: string[50]; Marks: array[1..5] of Integer; // Marks for 5 subjects end; var MyStudent: Student; ``` Advantages: Organizes related data into a single unit, improves code readability.

Disadvantages: Requires defining the record structure before use.

Example (South African Context): Storing information about a student, including their ID, name, surname, and marks in different subjects. Delphi

Example: ```delphi program RecordExample; type Student = record StudentID: Integer; Name: string[50]; Surname: string[50]; Marks: array[1..5] of Integer; // Marks for 5 subjects end; var MyStudent: Student; i: Integer; begin // Assign values to the student record MyStudent.StudentID := 20240001; MyStudent.Name := 'Thabo'; MyStudent.Surname := 'Nkosi'; for i := 1 to 5 do begin MyStudent.Marks[i] := Random(101); // Simulate marks between 0 and 100 end; // Display student information Writeln('Student ID: ', MyStudent.StudentID); Writeln('Name: ', MyStudent.Name); Writeln('Surname: ', MyStudent.Surname); Writeln('Marks:'); for i := 1 to 5 do begin Writeln('Subject ', i, ': ', MyStudent.Marks[i]); end; Readln; // Pause to see the output end. ``` 2.1.3 Linked Lists: A linked list is a dynamic data structure consisting of a sequence of nodes, where each node contains data and a pointer (or reference) to the next node in the sequence.

Definition (Delphi): Linked lists require the definition of a node type, containing the data and a pointer to the next node. ```delphi type NodePtr = ^Node; Node = record Data: Integer; // Or any other data type Next: NodePtr; end; var Head: NodePtr; ``` Advantages: Dynamic size (can grow or shrink as needed), efficient insertion and deletion of elements.

Disadvantages: Requires more memory (due to pointers), accessing a specific element requires traversing the list from the beginning.

Example (South African Context): Managing a queue of patients waiting for treatment at a clinic. Patients can be added or removed from the queue without needing to reallocate memory for the entire list. Delphi Example (Simplified - inserting a node at the beginning): ```delphi program LinkedListExample; type NodePtr = ^Node; Node = record Data: Integer; // Or any other data type Next: NodePtr; end; var Head: NodePtr; procedure InsertAtBeginning(var Head: NodePtr; NewData: Integer); var NewNode: NodePtr; begin New(NewNode); NewNode^.Data := NewData; NewNode^.Next := Head; Head := NewNode; end; procedure DisplayList(Head: NodePtr); var Current: NodePtr; begin Current := Head; while Current <> nil do begin Write(Current^.Data, ' '); Current := Current^.Next; end; Writeln; end; begin Head := nil; // Initialize empty list InsertAtBeginning(Head, 10); InsertAtBeginning(Head, 20); InsertAtBeginning(Head, 30); Writeln('Linked List:'); DisplayList(Head); Readln; end. ``` 2.2 Algorithms: Step-by-Step Solutions Algorithms are step-by-step procedures for solving a problem. We'll focus on searching and sorting algorithms. 2.2.1 Searching Algorithms: Linear Search: Sequentially checks each element in the list until the target element is found or the end of the list is reached.

When to Use: Suitable for small lists or when the list is not sorted.