Photo AI
Last Updated Sep 27, 2025
Revision notes with simplified explanations to understand Sub-Procedures quickly and effectively.
366+ students studying
Sub-procedures are smaller, self-contained units of code within a program that perform specific tasks. They are often referred to as functions or methods depending on the programming language. Sub-procedures help to break down complex problems into manageable parts, improving the readability, reusability, and maintainability of the code.
Understanding how to identify, design, and implement sub-procedures is essential for writing efficient and organised programs.
To identify sub-procedures:
Scenario 1: Online Shopping System
Scenario 2: Student Grading System
Pseudocode Example: Student Grading System
PROCEDURE inputGrades()
DECLARE grades AS ARRAY
FOR i = 1 TO 5
OUTPUT "Enter grade:"
INPUT grade
APPEND grade TO grades
ENDFOR
RETURN grades
ENDPROCEDURE
PROCEDURE calculateAverage(grades)
DECLARE total AS INTEGER = 0
FOR EACH grade IN grades
total = total + grade
ENDFOR
RETURN total / LENGTH(grades)
ENDPROCEDURE
PROCEDURE determineGrade(average)
IF average >= 70 THEN
RETURN "A"
ELSEIF average >= 60 THEN
RETURN "B"
ELSEIF average >= 50 THEN
RETURN "C"
ELSE
RETURN "F"
ENDIF
ENDPROCEDURE
PROCEDURE displayResults(grade)
OUTPUT "Final Grade: ", grade
ENDPROCEDURE
Flowchart Example: calculateAverage(grades)
Parameters are used to pass data into sub-procedures, making them more flexible and reusable.
Example: In the procedure calculateAverage(grades), grades is a parameter that allows the procedure to work with any set of grades.
A structure diagram visually represents the relationship between sub-procedures in a program. It shows the hierarchical organisation of tasks.
Example: Structure Diagram for Student Grading System
Main Program
├── inputGrades()
├── calculateAverage(grades)
├── determineGrade(average)
└── displayResults(grade)
Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!
30 flashcards
Flashcards on Sub-Procedures
Revise key concepts with interactive flashcards.
Try Computer Science Flashcards3 quizzes
Quizzes on Sub-Procedures
Test your knowledge with fun and engaging quizzes.
Try Computer Science Quizzes29 questions
Exam questions on Sub-Procedures
Boost your confidence with real exam questions.
Try Computer Science Questions27 exams created
Exam Builder on Sub-Procedures
Create custom exams across topics for better practice!
Try Computer Science exam builder12 papers
Past Papers on Sub-Procedures
Practice past papers to reinforce exam experience.
Try Computer Science Past PapersDiscover More Revision Notes Related to Sub-Procedures to Deepen Your Understanding and Improve Your Mastery
96%
114 rated
Thinking Procedurally
Components of a Problem in Computational Thinking
278+ studying
196KViewsJoin 500,000+ A-Level students using SimpleStudy...
Join Thousands of A-Level Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!
Report Improved Results
Recommend to friends
Students Supported
Questions answered