P2 - 06 - A - Class Activity - Subroutine
P2 - 06 - A - Class Activity - Subroutine
(a) (i) State the keyword other than FUNCTION, that suggests the following code is a function.
----------------------------------------------------------------------------
(ii) State why the algorithm is a function and not a procedure.
----------------------------------------------------------------------------
(iii) State what meant by a return value.
----------------------------------------------------------------------------
(b) (i) State and describe the common build in function used in the program.
----------------------------------------------------------------------------
(ii) Explain the deference between a build in function and a user define function.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
(c) State the name of the identifier used for the argument and identifier used for the parameters.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
(d) State the number of parameters there are in the code and name of them.
------------------------------------------------------------------------------
(e) Identify the local and global variable there are in the above program and name of them.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
(f) Give the line number(s) from the program of:
an Argument: ---- a Parameter: ----
a Local Variable: ---- a Global Variable: ----
a Function Definition: ---- a Return Value: ----
a Function Called: ---- A Build In Functions: ----
(g) Trace the algorithm to show the value returned when VaskarDC(7,2) is called.
Show each step of your working.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------