Sparklabs Learning
ClassesSearchPrintable packs
Back to SS 3 First Term
Full packLearner notesTeacher plansCurriculum onlyInclude all weeks

Sparklabs Learning / Digital Technology

SS 3 First Term

Week 4: Object-Oriented Programming

School
Creative Brains Academy
Subject
Digital Technology
Pack
Full pack
Prepared
7 November 2026

Week index

  1. 01Senior Review and Computational Problem Solving
  2. 02Advanced Programming
  3. 03Functions, Arrays and Data Structures
  4. 04Object-Oriented Programming
  5. 05Database Systems
  6. 06Computer Networks and Internet Technologies
  7. 07Web Development and Web Design
  8. 08Software Development Life Cycle
  9. 09Electronic Commerce
  10. 10Cyber Security and Emerging Digital Technologies
  11. 11Revision
  12. 12Examination

Week 4 / First Term

Object-Oriented Programming

Monday 28 September 2026 to Friday 2 October 2026

Lesson notes

Learning Objectives

  • Describe classes, objects, attributes and methods.
  • Explain encapsulation and inheritance.
  • Explain polymorphism and compare OOP with procedural programming.
  • Describe arrays, records, trees and graphs.

Classes, Objects, Attributes and Methods

Object-oriented programming (OOP) organises code into classes and objects. A class is a blueprint or template that describes what data and behaviour every object of that type will have. It defines the attributes, the data each object holds, and the methods, the behaviour each object can perform. The class does not hold specific data itself; it is the drawing of the house, while each object is an actual house built from that drawing. In JavaScript a class is defined with the class keyword and a constructor that runs when an object is created, setting the initial values of the attributes with the keyword this. A Student class, for example, has a constructor receiving name, admissionNo and score, and two methods, isPassing, which returns true when the score is 50 or above, and display, which prints the student's name and score.

An object is a specific instance of a class, created with the new keyword. Each object carries its own copy of the attributes, so student1.name is Chidinma Okoro while student2.name is Emeka Nwosu, even though both come from the same class blueprint. This is how one class models many real things of the same type, all the students of a school, all the accounts of a bank or all the books of a library. Practical work for this part is to design a BankAccount class with attributes for holder, account number and balance, and methods to deposit, withdraw and display the balance, then to create two accounts and perform several operations on each. The same class is used twice, but the balances remain separate.

Encapsulation and Inheritance

Encapsulation is the principle of bundling data and methods inside a class and restricting direct access to some attributes from outside the class. This protects the data from being changed in unexpected ways. In a bank app the balance must not be changed directly from outside the account object; it should only be changed through deposit and withdraw methods, which check that the values are valid. In JavaScript a private field is declared with a hash symbol, such as #balance, and can only be changed from inside the class through controlled methods. A deposit method adds only when the amount is positive; a withdraw method subtracts only when sufficient funds exist and otherwise reports insufficient funds. Encapsulation prevents accidental or malicious changes, makes debugging easier because every change flows through defined methods, and allows the internal design to evolve without breaking external code. In a school system grades should only be changed through proper processes, and encapsulation enforces that discipline in code.

Inheritance is a mechanism where a new class, called the child or derived class, inherits all the attributes and methods of an existing class, called the parent or base class. The child can use everything from the parent and can also add new features or change existing ones. This promotes code reuse, because the child does not rewrite what the parent already provides. A Person parent class might hold name and age and provide a display method. A Student child class extends Person with the super call to invoke the parent constructor, adds admissionNo and score, and extends the display method to show the extra data. The super call is how the child connects to its parent, both for construction and for reusing a parent method.

Polymorphism and Comparing OOP with Procedural Programming

Polymorphism means many forms. In OOP it means that different classes can implement the same method name in different ways, and the correct version runs automatically according to the object's type. A Circle class and a Rectangle class can both have an area method, but Circle returns pi times radius squared while Rectangle returns length times width. A loop that calls area on a list of mixed shapes does not need to know which shape it holds, because each object answers in its own way. In a school context a Teacher, a Cleaner and a SecurityOfficer each have a work method with different behaviour, and one loop can call work on all three. Adding a new staff type later does not change the loop, which is exactly the flexibility real projects need.

Procedural programming organises a program as functions that act on data stored separately, so data must be passed explicitly between functions and any part of the program can reach it. Object-oriented programming bundles related data and behaviour together in classes, so objects carry their own data and protect it through encapsulation. For large projects, OOP is easier to maintain because related code is grouped; for small simple programs, procedures remain perfectly appropriate. The two approaches are not enemies. Many real systems use procedures for simple logic inside objects.

A complete OOP example brings the ideas together. An Animal class holds a name and a sound method returning some sound. A Dog child class overrides sound to return Woof, and a Cat child class overrides it to return Meow. A list holding a Dog and a Cat, processed by one loop that calls sound, demonstrates inheritance, because both children reuse the parent name attribute, and polymorphism, because each answers the same method name in its own way. Scenario question for the systems work, a school library system needs a Book class holding title, author and ISBN, a Member parent class with borrowBook and returnBook, and StudentMember and TeacherMember children with different borrowing limits, naturally modelled with inheritance, encapsulation and polymorphism.

Advanced Data Structures: Arrays and Records

A single value, such as the name of one learner, is stored in a simple variable, but real programs handle many values at once, such as the names of all learners in a class. Data structures are the ways a program arranges collections of values so they can be stored, searched and processed efficiently. An array holds many values of the same type under one name with numbered positions, such as a list of term scores. A record groups different fields about a single item, such as name, admission number, class and score for one learner.

A simple variable holds one value; a data structure holds many related values.

An array stores many values of the same type with numbered positions.

Arrays suit lists such as class scores, phone contacts or product prices.

A record groups different fields about one item, such as name, score and class.

Programmers often combine the two: an array of records holds the whole class, and each record holds one learner details. This leads naturally into classes and objects, where each object groups its own data and behaviour.

Non-Linear Data Structures: Trees and Graphs

Arrays and records arrange data in a straight order, but many relationships branch or connect in many directions. A tree is a data structure with a single root whose branches spread downward into children and leaves with no loops. The folders in a computer form a tree, and a school directory of departments, classes and learners is also a tree. A graph is more general: nodes connected by edges, possibly with loops, like a road network or the connections between computers on the internet.

Tree: one root whose branches spread into children and leaves.

Graph: nodes connected by edges, possibly with loops, like roads or the internet.

File folders and school directories behave like trees.

The internet, road maps and friendships on social media behave like graphs.

A phone network uses graphs to route calls between cities, a bank uses a tree to organise branches, and navigation apps use graphs of streets to find the quickest route. Different problems call for different structures.

File Type Classifications

Every file belongs to a type that tells the computer what it contains and which program should open it. The most common way to identify a file type is by its extension, the letters after the final dot in the file name. Types are also grouped by content: text files hold characters, image files hold pictures, audio files hold sound and video files hold moving pictures.

Text files (.txt,.docx) hold letters, words and documents.

Image files (.jpg,.png) hold photographs and graphics.

Audio files (.mp3,.wav) hold music, speech and sound.

Video files (.mp4) hold moving pictures.

Data files (.xlsx,.csv) hold organised tables of values.

In a school office, the secretary keeps lesson notes as Word files, exam results as spreadsheets, the school logo as an image and assembly music as an audio file. The extension tells the computer which application to open, so knowing file classifications helps learners manage their work and supports the data organisation skills needed for the OOP capstone project.

FeatureProcedural programmingObject-oriented programming
OrganisationFunctions act on data kept separatelyClasses bundle data and methods together
Data handlingData passed between functionsData held as attributes inside objects
ReusabilityFunctions reusable, data passed explicitlyObjects carry their own data and behaviour
Large projectsHarder to maintain as code growsEasier to maintain with related code grouped
Real-world modellingLess natural for entitiesNatural for students, accounts, vehicles
SecurityData reachable from anywhereEncapsulation restricts direct access

Practical Work

  1. Write a class with attributes and a method.
  2. Explain how a subclass inherits from a parent class.
  3. Give one example each of a tree and a graph.
  4. Compare OOP and procedural programming in a table.

Scenario-Based Questions

  1. A school management system has classes Student, Teacher and Course. Student has attributes name and scores, and a method average(). Teacher has attributes name and department. Course has attributes title and a list of Student objects. Design these three classes by writing their attribute lists and method names. Explain how encapsulation protects student scores from being changed by unrelated code.
  2. A bank has a base class Account with attributes owner and balance and methods deposit and withdraw. It creates two child classes SavingsAccount (which adds an interest rate and a method applyInterest) and CurrentAccount (which adds an overdraft limit). Write the class hierarchy and explain how inheritance avoids rewriting deposit and withdraw.
  3. A school project simulates different vehicles. A base class Vehicle has a method move(). A Car child class overrides move to print 'Driving on road', a Boat child class overrides move to print 'Sailing on water' and a Plane child class overrides move to print 'Flying in air'. Explain how polymorphism allows one function driveAll that takes any Vehicle object and calls move() without knowing the exact type.
  4. Compare procedural and object-oriented approaches for building a school grading system. List two advantages of OOP over procedural programming when the system must later add new features such as attendance tracking and fee management.
  5. A programmer creates two Student objects: student1 = Student('Ada', 88) and student2 = Student('Ada', 88). Explain whether these are the same object in memory. Then describe what the constructor (__init__) does and why it is essential for setting initial attribute values.
  6. An online game has a base class Character with health and attack power. A Warrior child class adds a shield attribute, and a Mage child class adds a spellPower attribute. Both override an attack() method differently. Explain how inheritance and polymorphism together allow the game to process a list of characters of mixed types in a single loop.
  7. A programmer has an existing Animal class with a sound() method returning 'Some sound'. They create Dog, Cat and Cow child classes, each overriding sound(). Write the three child class definitions and explain why adding a new Animal type later requires no changes to code that already processes Animal objects.

Teacher plan

LEARNING OBJECTIVES: BY THE END OF THE LESSON STUDENTS SHOULD BE ABLE TO:

Cognitivei. Describe classes, objects, attributes and methods. ii. Explain encapsulation and inheritance. iii. Explain polymorphism and compare OOP with procedural programming. iv. Describe arrays, records, trees and graphs.
Affectivei. Appreciate the value of Object-Oriented Programming in school, at home and in the community. ii. Show willingness to use digital tools carefully, safely and responsibly.
Psychomotori. Write a class with attributes and a method. ii. Explain how a subclass inherits from a parent class. iii. Give one example each of a tree and a graph. iv. Compare OOP and procedural programming in a table.

Rationale: Object-oriented programming (OOP) organises code into classes and objects. Understanding classes, Objects, Attributes and Methods, encapsulation and Inheritance, polymorphism and Comparing OOP with Procedural Programming, advanced Data Structures: Arrays and Records helps learners use digital technology confidently, safely and responsibly.

Pre-requisite Knowledge: In Week 3, learners studied Functions, Arrays and Data Structures, including arrays and Lists in Detail, functions That Process Lists, searching, Sorting and Why Data Structures Matter. The knowledge from that week is used again in this lesson.

Learning Material/Teaching Aid: Whiteboard, markers, computer or laptop where available, printed notes and charts on Object-Oriented Programming, practical task sheets, learners' notebooks and pens.

Reference Materials: Digital Technology for Senior Secondary Schools (SS 3); NERDC Digital Technology Curriculum; Digital Technology SS 3 First Term Notes (Week 4); First Term examination and Continuous Assessment question papers.

LESSON DEVELOPMENT

Stage/Step
(Time)
Teacher's ActivitiesStudent's ActivitiesLearning Points
Introduction
5 MINUTES
Welcomes learners, revises Week 3 (Functions, Arrays and Data Structures) with two quick oral questions, and asks what they already know about Object-Oriented Programming. Elicits responses and writes the topic on the board.Recall the previous lesson and share what they already know about Object-Oriented Programming.Connecting prior knowledge to Object-Oriented Programming.
Step 1
6 MINUTES
Covers Classes, Objects, Attributes and Methods: Object-oriented programming (OOP) organises code into classes and objects. A class is a blueprint or template that describes what data and behaviour every object of that type will have. Covers Encapsulation and Inheritance: Encapsulation is the principle of bundling data and methods inside a class and restricting direct access to some attributes from outside the class. This protects the data from being changed in unexpected ways.Listen, take notes and answer oral questions on "Classes, Objects, Attributes and Methods" and related points.Understanding: Classes, Objects, Attributes and Methods; Encapsulation and Inheritance.
Step 2
6 MINUTES
Covers Polymorphism and Comparing OOP with Procedural Programming: Polymorphism means many forms. In OOP it means that different classes can implement the same method name in different ways, and the correct version runs automatically according to the object's type. Covers Advanced Data Structures: Arrays and Records: A single value, such as the name of one learner, is stored in a simple variable, but real programs handle many values at once, such as the names of all learners in a class.Copy the key points, give examples from school and everyday life, and ask questions on "Polymorphism and Comparing OOP with Procedural Programming" and related points.Understanding: Polymorphism and Comparing OOP with Procedural Programming; Advanced Data Structures: Arrays and Records.
Step 3
6 MINUTES
Covers Non-Linear Data Structures: Trees and Graphs: Arrays and records arrange data in a straight order, but many relationships branch or connect in many directions. A tree is a data structure with a single root whose branches spread downward into children and leaves with no loops.Discuss in pairs, then report one point on "Non-Linear Data Structures: Trees and Graphs" to the class.Understanding: Non-Linear Data Structures: Trees and Graphs.
Step 4
6 MINUTES
Covers File Type Classifications: Every file belongs to a type that tells the computer what it contains and which program should open it. The most common way to identify a file type is by its extension, the letters after the final dot in the file name.Respond to questions, complete the examples on the board and note down "File Type Classifications".Understanding: File Type Classifications.
Practical Work
6 MINUTES
Guides learners through the practical work: (i) Write a class with attributes and a method. (ii) Explain how a subclass inherits from a parent class. (iii) Give one example each of a tree and a graph. Moves round the class to check progress and correct unsafe or careless use.Carry out the practical tasks individually or in pairs and record what they did in their notebooks.Applying the lesson through hands-on practice.
Evaluation
3 MINUTES
Asks learners to: i. Describe classes, objects, attributes and methods. ii. Explain encapsulation and inheritance. iii. Explain polymorphism and compare OOP with procedural programming. iv. Describe arrays, records, trees and graphs.Respond verbally and in writing to the evaluation questions.Assessment and consolidation of the lesson content.
Conclusion
2 MINUTES
Recaps the main points: classes, Objects, Attributes and Methods, encapsulation and Inheritance, polymorphism and Comparing OOP with Procedural Programming, advanced Data Structures: Arrays and Records, non-Linear Data Structures: Trees and Graphs. Links them to the assignment and previews Week 5: Database Systems.Listen, ask questions and copy the assignment.Reinforcement of key concepts and a preview of the next lesson.

Assignment: i. A developer must stop a balance being edited directly, avoid rewriting the same code for students and teachers, and handle a list of mixed shapes. Explain encapsulation, inheritance and polymorphism, and state how procedural programming differs from the object-oriented approach. ii. A school management system has classes Student, Teacher and Course. Student has attributes name and scores, and a method average(). Teacher has attributes name and department. Course has attributes title and a list of Student objects. Design these three classes by writing their attribute lists and method names. Explain how encapsulation protects student scores from being changed by unrelated code.

Sparklabs Learning / SS 3 First Term / Full pack

Lesson content is provided for classroom planning. Adapt timings and tasks to the approved school calendar and available devices.

Sparklabs Learning

Digital Technology lesson notes and teaching plans for JSS 1 to SS 3.

Curriculum

Open educational resources for JSS 1 to SS 3 Digital Technology.

Quick links

Search the curriculumBrowse classesPrintable term packs

Academic session 2026 / 2027