Assignment, Variables, Constants & Sequences
Inputs, Outputs & Type Conversion
IF Statements & Boolean Operators
Nested Selection and Iteration
WHILE, REPEAT-UNTIL Loops
Validation and verification
Validation and authentication routines
High-level & Low-level languages
Assemblers, Compilers & Interpreters
In computer programming, a procedure is a set of coded instructions that tell a computer how to run a program or calculation.
Many different types of programming languages can be used to build a procedure. Depending on the programming language, a procedure may also be called a subroutine, subprogram or function.
We can also pass information to our procedure through parameters.
The terms parameter and argument are sometimes used interchangeably. However, parameter refers to the type and identifier, and arguments are the values passed to the function.
Below you can see our procedure has a single parameter called 'name' which we use to say hello to a person.
1. Simple Procedure
Create a procedure called hello
PROCESS - Call the hello procedure four times
OUTPUT - The word hello is output four times
2. Simple Procedure with parameter
Create a procedure called userName
USERINPUT - User enters their name
OUTPUT - The users name is output with a message
3. Simple Procedure
Create a procedure called userMenu
OUTPUT - The userMenu is output with a message
4. Single Parameter
USERINPUT - The user enters a number
PROCESS A procedure called double is given the number
OUTPUT - The procedure outputs the value of the number doubled
5. Double Parameter
USERINPUT - The user enters two numbers
PROCESS A procedure called multiply is given the two numbers
OUTPUT - The procedure outputs the value of the numbers multiplied together
Click on the button below and complete as many exercises as you can
I can copy code to use a procedure with a parameter.
I can create my own code to to use a procedure with a parameter.
I can create my own procedure that uses multiple parameters.