<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><tt>Thanks everyone, you wouldn't have thought this
was a NSW Year 12 IT exam question, quite ambiguous. Guess they
were just trying to throw red herrings about the second loop.
Good to know I'm not yet completely bonkers. This is such a
wonderful list! Where else in education could you cry for help
in frustration and have a half a dozen compatriots help you out
inside an hour? Never ceases to amaze me, the people who make up
this list are some of the nicest and most helpful you could ever
come across.<br>
</tt></font>
<pre class="moz-signature" cols="72">Regards,
Brett Groves
ICT Manager
Croydon Secondary College</pre>
<br>
On 25/05/11 11:43, Brett Groves wrote:
<blockquote cite="mid:4DDC5EAC.4040207@edumail.vic.gov.au"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title></title>
Hi all,<br>
<br>
Wondering if some kind soul who is good with desk checks / pseudo
code can help me out here. We are about to commence OC2 (running a
week late) and I have given my students some algorithms to
evaluate for revision. On one in particular I realised I made an
error of logic when evaluatiing it myself and have now confused my
self to point of frustration. It's the one below. It has two count
loops which it uses to select data in an array but they both have
identical conditions. As I am currently reading it values will
never be passed to the second loop as the evaluation condition
that ends the first loop will also end the second???? Scratches
head......sure I'm failing to see obvious! Can anyone help pls<br>
<br>
Brett<br>
<style type="text/css">p { margin-bottom: 0.21cm; }</style>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small><b>Question 12:</b></small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>The following diagram shows the
contents of an array of records used for mixing
colours.</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>The name of the array is
‘COLOUR’.</small></small></font></font></small></small></p>
<small><small><font face="Garamond, serif"><font style="font-size:
11pt;" size="2"><small><small>The algorithm below is used
to calculate colour values, using an array.</small></small></font></font></small></small>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>BEGIN</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>SET TOTAL TO 0</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>SET COUNTER TO 1</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>WHILE COUNTER < 4</small></small></font></font></small></small></p>
<p style="margin-left: 1.27cm; text-indent: 1.27cm; margin-bottom:
0cm;" lang="en-US"><small><small> <font face="Garamond, serif"><font
style="font-size: 11pt;" size="2"><small><small>TOTAL =
TOTAL + COLOUR [COUNTER] . GREENVALUE</small></small></font></font></small></small></p>
<p style="margin-left: 1.27cm; text-indent: 1.27cm; margin-bottom:
0cm;" lang="en-US"><small><small> <font face="Garamond, serif"><font
style="font-size: 11pt;" size="2"><small><small>ADD 1 TO
COUNTER</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>ENDWHILE</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>WHILE COUNTER < 4</small></small></font></font></small></small></p>
<p style="margin-left: 1.27cm; text-indent: 1.27cm; margin-bottom:
0cm;" lang="en-US"><small><small> <font face="Garamond, serif"><font
style="font-size: 11pt;" size="2"><small><small>TOTAL =
TOTAL + COLOUR [COUNTER] . REDVALUE</small></small></font></font></small></small></p>
<p style="margin-left: 1.27cm; text-indent: 1.27cm; margin-bottom:
0cm;" lang="en-US"><small><small> <font face="Garamond, serif"><font
style="font-size: 11pt;" size="2"><small><small>ADD 1 TO
COUNTER</small></small></font></font></small></small></p>
<p style="text-indent: 1.27cm; margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>ENDWHILE</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>PRINT TOTAL</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>END</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><br>
</small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>What will be the output of this
algorithm?</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>(A) 10</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>(B) 11</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>(C) 18</small></small></font></font></small></small></p>
<p style="margin-bottom: 0cm;" lang="en-US"><small><small><font
face="Garamond, serif"><font style="font-size: 11pt;"
size="2"><small><small>(D) 25</small></small></font></font></small></small></p>
<br>
<p><b>Important - </b>This email and any attachments may be
confidential. If received in error, please contact us and delete
all copies. Before opening or using attachments check them for
viruses and defects. Regardless of any loss, damage or
consequence, whether caused by the negligence of the sender or
not, resulting directly or indirectly from the use of any
attached files our liability is limited to resupplying any
affected attachments. Any representations or opinions expressed
are those of the individual sender, and not necessarily those of
the Department of Education and Early Childhood Development.</p>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.edulists.com.au">http://www.edulists.com.au</a> - FAQ, Subscribe, Unsubscribe
IT Software Development Mailing List kindly supported by
<a class="moz-txt-link-freetext" href="http://www.vcaa.vic.edu.au">http://www.vcaa.vic.edu.au</a> - Victorian Curriculum and Assessment Authority and
<a class="moz-txt-link-freetext" href="http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html">http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html</a>
<a class="moz-txt-link-freetext" href="http://www.vitta.org.au">http://www.vitta.org.au</a> - VITTA Victorian Information Technology Teachers Association Inc</pre>
</blockquote>
<p></p><p><b>Important - </b>This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Early Childhood Development.</p>
</body>
</html>