Skip to content

Code Repository

Assessment rule

Students can use code repositories as part of normal teaching and learning to become familiar with key knowledge. They must not use code repositories for work completed as part of assessment, because teachers need to authenticate student work.

Quick Reference Code Examples

This section contains simple, practical code examples organized by topic. Each example is designed to be easy to understand and directly usable in your projects.


Available Topics

Loop Examples

  • FOR Loops - Simple and advanced examples for when you know exactly how many times to repeat
  • WHILE Loops - Simple and advanced examples for repeating until a condition is met
  • DO/WHILE Loops - Simple and advanced examples that must run at least once

File I/O Examples

  • TXT Files - Reading and writing plain text files
  • CSV Files - Working with delimited (comma-separated) data
  • XML Files - Handling hierarchical XML data

Windows Forms Applications

  • Toilet List App (Step-by-Step Build) - Event-driven Windows Forms tutorial using ListBoxes and TXT file input
  • Windows Forms GUI Chunks - Assessment-safe snippets for Items.Add, SelectedIndex, and MessageBox.Show patterns

Algorithm Examples

  • Search Algorithms - Linear and binary search implementations
  • Sort Algorithms - Selection sort and quick sort implementations

Object-Oriented Programming

  • Variables and Constants - Scope and best practices
  • Functions and Methods - Modular code patterns
  • Classes and Objects - Blueprint and instance examples
  • OOP Principles - Abstraction, encapsulation, generalisation, and inheritance

SAC Practice

  • SAC Module 1 PRACTICE - Practice assessment code templates and worked examples
  • SAC Module 2 PRACTICE - Student Results WinForms practice task with CSV load/save and validation

How to Use

  1. Navigate to a topic in the left sidebar.
  2. Open the page you need.
  3. Study the pattern, then adapt it into your own work.
  4. Keep assessment rules in mind when you move from practice to assessed tasks.

For Students

These examples are best used as practice references during class learning. Build your own assessed solutions from your own understanding, designs and documentation.