Photo AI
Last Updated Sep 26, 2025
Revision notes with simplified explanations to understand Sub Programs quickly and effectively.
369+ students studying
Sub programs are smaller, reusable blocks of code that are used to structure larger programs. They allow you to break down complex problems into smaller, manageable tasks. The two main types of sub programs are functions and procedures.
function triple(number)
return number * 3
endfunction
y = triple(7)
|
| Procedure | A sub program that performs a task but does not return a value. | procedure greeting(name)
print("Hello " + name)
endprocedure
greeting("Hamish")
|Sub programs can use two types of variables:
Arrays can be passed to and returned from sub programs, allowing the manipulation of multiple values at once:
Arrays can be passed into sub programs as arguments, allowing you to perform operations on large sets of data.
Example:
procedure printNames(names)
for name in names:
print(name)
endprocedure
Calling: printNames(["Bob", "Alice", "Eve"])
Functions can also return arrays, which allows them to process and return multiple values at once.
Example:
function getMultiples(numbers)
for i in range(0, len(numbers)):
numbers[i] = numbers[i] * 2
return numbers
endfunction
Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!
80 flashcards
Flashcards on Sub Programs
Revise key concepts with interactive flashcards.
Try Computer Science Flashcards8 quizzes
Quizzes on Sub Programs
Test your knowledge with fun and engaging quizzes.
Try Computer Science Quizzes8 questions
Exam questions on Sub Programs
Boost your confidence with real exam questions.
Try Computer Science Questions1 exams created
Exam Builder on Sub Programs
Create custom exams across topics for better practice!
Try Computer Science exam builder13 papers
Past Papers on Sub Programs
Practice past papers to reinforce exam experience.
Try Computer Science Past PapersDiscover More Revision Notes Related to Sub Programs to Deepen Your Understanding and Improve Your Mastery
Join 500,000+ GCSE students using SimpleStudy...
Join Thousands of GCSE Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!
Report Improved Results
Recommend to friends
Students Supported
Questions answered