The Student Room Group

computer science help plz

hey guys can someone please help me to answer this question for me. its very hard for me.
1. (a) How many lines of output will the following pseudocode algorithm produce?
Show your calculation. [3]
for a = 8 to 19 step 4
for b = 1 to 3
if a mod b >= b/3 then
if a/4 <= b+1 then
print (“Homer”)
else
print (“Marge”)
endif
else
print (“Bart”)
endif
next b
next a

(b) Trace through the pseudocode and write down what is output. [4]

thanks

Quick Reply

Latest

Trending

Trending