Sparklabs Learning / Digital Technology
SS 3 First Term
Week 4: Object-Oriented Programming
- School
- Creative Brains Academy
- Subject
- Digital Technology
- Pack
- Curriculum only
- Prepared
- 7 November 2026
Week index
- 01Senior Review and Computational Problem Solving
- 02Advanced Programming
- 03Functions, Arrays and Data Structures
- 04Object-Oriented Programming
- 05Database Systems
- 06Computer Networks and Internet Technologies
- 07Web Development and Web Design
- 08Software Development Life Cycle
- 09Electronic Commerce
- 10Cyber Security and Emerging Digital Technologies
- 11Revision
- 12Examination
Week 4 / First Term
Object-Oriented Programming
Monday 28 September 2026 to Friday 2 October 2026
Curriculum outline
Lesson objectives
On completion, candidates should be able to:
- Define class, object, attribute and method.
- Write a two-attribute constructor.
- Create objects and call methods.
- Reject an overdrawn withdrawal.
- Explain encapsulation's benefit.
Key vocabulary
- Class: a template for objects.
- Object: one instance of a class.
- Attribute: a named value on an object.
- Method: a function inside a class.
- Constructor: the init method.
- Encapsulation: data kept with its methods.
Common misconceptions
- "A class is an object." The class is the template; the object is an instance.
- "self stores the class name." self refers to the current object.
Teacher activities
- Starter: sort class and attribute nouns.
- Teach the class-object link.
- Model a two-attribute constructor.
- Add deposit and withdraw guards.
- Run one rejected withdrawal.
- Ask why the balance survives.
Student activities
- Complete the class sort.
- Copy the Account skeleton.
- Write deposit with a guard.
- Write withdraw with a funds guard.
- Test one rejected withdrawal.
- Add a balance report.
class Account:
def __init__(self, owner, balance=0):
self.owner = owner
self.balance = balance
def deposit(self, amount):
if amount > 0:
self.balance = self.balance + amount
def withdraw(self, amount):
if 0 < amount <= self.balance:
self.balance = self.balance - amount
return True
return False
a = Account("Ngozi", 5000)
a.deposit(2500)
print(a.withdraw(9000))
print(a.owner, a.balance)
Expected output:
False
Ngozi 7500
Practical / learning evidence
ss3_account_musa.py defines Account with a constructor, deposit and withdraw, creates two objects and records three tests. Success needs correct self references and a balance of 7500.
Resources and preparation
Python 3, projector and a printed skeleton. Offline route: trace calls on an object diagram and write each attribute value.
Assessment for learning
Look for self on every attribute and a Boolean return from withdraw. Watch for a balance changed before the guard.
Inclusion and homework
Give the skeleton with method signatures; extend others with a transfer method. Homework: add a 4% interest method on 7500.