ATAR Notes: Forum
VCE Stuff => VCE Technology => VCE Mathematics/Science/Technology => VCE Subjects + Help => VCE Computing: Software Development => Topic started by: excal on October 14, 2008, 10:52:03 am
-
These are taken from a university-level programming subject, just to give you a taste of how capable you guys will probably have become after your year of IT:SD.
1a. Rewrite in psuedocode the following IF statement to use nested IFs
IF (age < 18 AND duration = 2 AND fareZone ="Zone 1") THEN
cost = 3.75
END IF
b. Explain in plain english what this psuedocode is attempting to do.
2. How many times will the following algorithm execute?
num1 = 10
num2 = 2
DO WHILE (num1 < num2)
num1 = num1 / 2
num2 = num2 * num2
END DO
-
I will pay 20 dollars to whoever determines, with proof, the positive integer values of n for which the code below terminates.
n = positive integer
while (n is not equal to 1)
if (n % 2 == 1)
n = 3*n + 1
else
n = n/2
end if
end while
-
1?
-
Is that the only value? (:
-
Probably not, given the fact that you've questioned me :P
2^a, where a is another positive integer
5 works as well
and 3
in fact all of them <=10 work =/
-
Ooo IT! :P
2. How many times will the following algorithm execute?
num1 = 10
num2 = 2
DO WHILE (num1 < num2)
num1 = num1 / 2
num2 = num2 * num2
END DO
Hmm..trick question? It shouldn't execute at all, because 10 is not lower than 2. If I'm completely wrong, let me know :D
Hopefully exam won't be too bad...but if practice exam we did was any indication, not good! Haha well did no study for that and got like 60%, so obviously a lot of cramming to come.
I vote we have some revision sessions on this forum :)