Benefits of Using Subprograms (Edexcel GCSE Computer Science)
Revision Note
Introduction to Using Subprograms
What is a subprogram?
Subprograms are an out of line block of code that may be called by simply writing their name in a program
Subprograms are given a unique name so they can be called anywhere in a program
There are many benefits to using Subprograms, these include
Making bigger problems easier to break down (decompose) and code
Allows team members to be able to work on different parts of a problem
Makes the program easier to debug
Makes programs more efficient as code is not duplicated
There are two main types of subprogram:
Procedures - does not return a result
Functions - returns one or more results to the calling code
Examples of using subprograms
Python code |
---|
|
Last updated:
You've read 0 of your 10 free revision notes
Unlock more, it's free!
Did this page help you?