Parameter Passing (1 Viewer)

hjed

Member
Joined
Nov 10, 2011
Messages
211
Gender
Undisclosed
HSC
2013
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.
 

Raolan

Member
Joined
Oct 22, 2012
Messages
77
Gender
Male
HSC
2013
The marker's aren't brain dead, they understand pseudocode logic as long as you're not being vague.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top