Section 2B - Programming Techniques Flashcards
What is a subroutine?
A subroutine is a named, self-contained section of code that performs a specific task.
What are the 2 different types of subroutine?
Procedures and functions
What is a parameter?
To make the subroutine more useful, you can pass it one or more times through parameters. The parameter is a variable named in the subroutine heading that will receive and use whatever value you pass it.
What is a local variable?
Variables which functions and procedures may use their own variables, that do not get recognised in the main code.
What is a global variable?
A global variable is one which is declared in the main program an is recognised in all the subroutines.
What is a range check?
Whether a number or date os within a sensible/ allowed range
What is a type check?
Data is the right type such as an integer, a letter or text
What is length check?
Text entered is not too long or too short
What is a presence check?
Checks that some data has been entered
What is a format check?
Checks the format of, for example, a postcode or email address is appropriate.
What is a trace table?
Thos shows how the value of a variable changes as each step pf the algorithm is executed.