In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subroutines are used to :
Below is a flowchart for our lighthouse which shows us how we can use a subroutine to make the lighthouse lamp flash by reusing the same flowchart.
Using the flowchart above create a subroutine called 'flashes' which makes the lighthouse lamp flash, see what the addition of the number below to our subroutine does to our mimic.
You should now be able to assess yourself against your objectives: