I put B, but technically I can't see that any of the answers are correct. C and D are obviously wrong so that leaves A and B. With A, b isn't a paramater passed to M2, its a value returned to M1. Hence it shouldn't be in the first line as a parameter for M2. With B, a and d are both passed to M2, but d still shouldn't be a parameter for M2 as it's supposedly the return from a call made to M4.15 would have been A. If you were to imagine M1 calling M2 the line would have been:
M2 (a,b) as a and b were the names of the parameter and control parameter/flag between the two.
Hence the first line would have been:
BEGIN SUBPROGRAM M2 (a,b)
this comes back to the stupid way the HSC psuedocode works. according to the specifications, there's no psuedocode instruction to "return" a value. instead they like to use a parameter in the subprogram that is assumed to be passed by reference. so something like:I put B, but technically I can't see that any of the answers are correct. C and D are obviously wrong so that leaves A and B. With A, b isn't a paramater passed to M2, its a value returned to M1. Hence it shouldn't be in the first line as a parameter for M2. With B, a and d are both passed to M2, but d still shouldn't be a parameter for M2 as it's supposedly the return from a call made to M4.
That's how I see it anyway. Can anyone else shed any light on this?
BEGIN MAINLINE
a = "hello"
doStuff(a, b)
PRINT b
END MAINLINE
BEGIN SUBPROGRAM doStuff(first, second)
second = first
END SUBPROGRAM
BEGIN MAINLINE
a = "hello"
b = doStuff(a)
PRINT b
END MAINLINE
BEGIN SUBPROGRAM doStuff(first)
RETURN first
END SUBPROGRAM