Hey guys
Just wanted to clarify something:
often in exams they will have a structure chart with parameters being received by a module and returned by it.
For example the module algorithm2 receives the parameters a and b and returns c.
Would it be ok to write algorithm 2 as
BEGIN algorithm2 (a, b)
DO SOMETHING
...
RETURN C
END algorithm2
or do you have to write it as:
BEGIN algorithm2 (a, b,c)
DO SOMETHING
...
SET c = blah
END algorithm2
Course specs do specify the return keyword, but it is unclear when it is acceptable to use it.
Just wanted to clarify something:
often in exams they will have a structure chart with parameters being received by a module and returned by it.
For example the module algorithm2 receives the parameters a and b and returns c.
Would it be ok to write algorithm 2 as
BEGIN algorithm2 (a, b)
DO SOMETHING
...
RETURN C
END algorithm2
or do you have to write it as:
BEGIN algorithm2 (a, b,c)
DO SOMETHING
...
SET c = blah
END algorithm2
Course specs do specify the return keyword, but it is unclear when it is acceptable to use it.