2. 2
Parameters and Arguments
●
A parameter is a variable in a method definition
or declaration
where as
●
Arguments are the data that can be passed at
the time of calling a function.
5. 5
Actual Parameters
●
The parameter listed in a function call are called
the actual parameters.
●
The data type of arguments and the formal
parameters should match according to the
order they are passed to the procedure.
6. 6
Example:
●
REM program to find simple interest.
DECLARE SUB SI(X,Y,Z)----------(Formal parameters)
CLS
INPUT “Enter Total Amount”; P
INPUT “Enter the Time Period”;T
INPUT “Enter a Rate”;R
CALL SI(P,T,R)----------------------(Arguments/Actual Parameter)
END
SUB SI(X,Y,Z)
SI = (X*Y*Z)/100
PRINT”Simple Interest=”;SI
END SUB