Skip to content

a. What You Need To Know

Data structures

Data structures organise related data so it can be accessed and managed efficiently.

They are more complex than single variables because they deal with collections of values.

One-dimensional arrays

A one-dimensional array stores multiple values of the same data type in an ordered structure.

Each value is accessed using an index position.

Structure Main idea Typical use
Array Ordered collection of same-type values Storing scores, names, prices
List Ordered collection that can be more flexible in some languages Managing changing collections
Record Group of related fields, often with different data types Storing details about one person or one item

Key Point

Arrays are useful when you need to process a collection of related items efficiently, especially when looping, searching or sorting.

Lists

Lists are ordered collections. In some languages they behave similarly to arrays but may be more flexible, such as allowing easier resizing.

Records and fields

A record groups related pieces of data together. Each field within the record has its own name and can store a different kind of data.

For example, a student record might include:

  • first name
  • year level
  • house
  • date of birth

Functions, procedures and methods

Modular programming means breaking a larger program into smaller, named parts.

Functions

A function is a named block of code that performs a task and usually returns a value.

Procedures

A procedure is a named block of code that performs a task but does not usually return a value.

Methods

A method is a function or procedure that belongs to a class or object.

Parameters and arguments

Functions and procedures can receive inputs through parameters. These inputs allow the same code to be reused with different data.

Useful distinction

Function: usually returns a value. Procedure: usually performs an action. Method: a function or procedure inside a class.


Object-oriented programming

Object-oriented programming, or OOP, organises software around objects. These objects combine data and the actions that work on that data.

Classes

A class acts like a template for creating objects. It groups related variables and methods together in one place.

Objects

An object is an instance created from a class.

Methods and events

Methods are the actions an object can perform. Some methods are triggered by events, such as clicking a button in a graphical interface.


Abstraction

Abstraction is about focusing on the important features of an object and hiding unnecessary detail.

A user of a class should be able to work with the useful parts of it without needing to know everything happening behind the scenes.

For example, a music player lets a user press play, pause or skip without needing to understand the audio processing happening underneath.


Encapsulation

Encapsulation means bundling data and the methods that work on that data into one class, then controlling access to that data.

This protects the internal state of the object and helps stop invalid or careless changes.

For example, a bank account should not allow anyone to directly overwrite the balance at any time. Instead, balance changes should happen through controlled methods such as deposit or withdraw.

Why this matters

Encapsulation protects data integrity. It stops other parts of the program from changing important data in unsafe ways.


Why these ideas belong together

Arrays, lists and records help programs manage larger collections of data. Functions, procedures and methods help organise code. OOP ideas such as abstraction and encapsulation help developers design software that stays manageable as it grows.

Together, these ideas move you from very small programs to better-structured solutions.


What this means for your folio

In your folio, you should be able to:

  • choose a suitable data structure for a task
  • break long solutions into reusable functions or procedures
  • explain what a method is and how it differs from a standalone function
  • describe abstraction and encapsulation in a practical programming context

These are the ideas that make a solution feel organised instead of messy.