<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Garamond;
        panose-1:2 2 4 4 3 3 1 1 8 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        margin-bottom:5.95pt;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Surely the total depends on the values of redvalue and greenvalue which aren&#8217;t given. As it stands, only greenvalue would be used as you would skip the second loop.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>John<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><TABLE border=0 cellPadding=5 width=200>
  <TBODY>
  <TR>
    <TH scope=col><IMG align=left 
      src="cid:parade-colour-crest-small127e.gif" 
      width=93 height=105></TH>
    <TH scope=col noWrap>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 10pt" 
      align=left>John Schwartz</P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left> </P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left><FONT color=#800080>Parade College</FONT></P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left>1436 Plenty Road</P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left>Bundoora, Victoria, 3083</P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left>Phone: 03 9468 3300</P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left>Fax: 03 9467 3937 </P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left></P>
      <P style="MARGIN: 0cm 0cm 0pt; FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt" 
      align=left>e-mail: <A href="mailto:jschwartz@parade.vic.edu.au">jschwartz@parade.vic.edu.au</A> | web: <A 
      href="http://www.parade.vic.edu.au" 
      target=_blank>www.parade.vic.edu.au</A></P></TH></TR></TBODY></TABLE><br><P 
style="MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; align: left" 
dir=ltr class=MsoNormal><U3:COUNTRY-REGION u4:st="on"><U3:PLACE u4:st="on"><SPAN 
style="mso-bookmark: _MailAutoSig"><B><SPAN 
style="FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt; mso-no-proof: yes">&nbsp; 
</SPAN></B></SPAN></U3:PLACE></U3:COUNTRY-REGION><BR><A 
title="Parade College Open Day: Sunday 14th February 2010" 
href="http://www.parade.vic.edu.au/"><IMG style="WIDTH: 567px; HEIGHT: 116px" 
border=0 hspace=0 alt="Wizard of Oz Musical Production" 
src="cid:wizemailbanner35.jpg" 
width=567 height=116></A></P><br><DIV style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; align: left" 
class=MsoNormal><U3:COUNTRY-REGION u4:st="on"><U3:PLACE u4:st="on"><SPAN 
style="mso-bookmark: _MailAutoSig"><B><SPAN 
style="FONT-FAMILY: Verdana; FONT-SIZE: 7.5pt; mso-no-proof: yes">
<HR>
</DIV>
<DIV></SPAN></B></SPAN></U3:PLACE></U3:COUNTRY-REGION><U3:COUNTRY-REGION 
u4:st="on"><U3:PLACE u4:st="on"><SPAN style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: Verdana; COLOR: gray; FONT-SIZE: 7.5pt; mso-no-proof: yes; mso-ansi-language: EN-US" 
lang=EN-US>This e-mail and any attachments may be confidential. You must not 
disclose or use the information in this e-mail if you are not the intended 
recipient. If you have received this e-mail in error, please notify <U3:PLACE 
u11:st="on"><U3:PLACENAME u11:st="on"><U1:PLACE u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><U1:PLACENAME u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:place w:st="on"><st1:PlaceName 
w:st="on">Parade</U1:PLACENAME></U1:PLACE></U3:PLACENAME></st1:PlaceName></st1:place> 
<U3:PLACETYPE u11:st="on"><U1:PLACETYPE u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:PlaceType 
w:st="on">College</U1:PLACETYPE></U3:PLACETYPE></U3:PLACE></st1:PlaceType> on 
(03) 9468 3300 immediately and delete the e-mail and all copies. <U3:PLACE 
u11:st="on"><U3:PLACENAME u11:st="on"><U1:PLACE u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><U1:PLACENAME u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:place w:st="on"><st1:PlaceName 
w:st="on">Parade</U1:PLACENAME></U1:PLACE></U3:PLACENAME></st1:PlaceName></st1:place> 
<U3:PLACETYPE u11:st="on"><U1:PLACETYPE u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:PlaceType 
w:st="on">College</U1:PLACETYPE></U3:PLACETYPE></U3:PLACE></st1:PlaceType> does 
not guarantee that this e-mail is virus or error free. The attached files are 
provided and may only be used on the basis that the user assumes all 
responsibility for any loss, damage or consequence resulting directly or 
indirectly from the use of the attached files, whether caused by the negligence 
of the sender or not. Any views expressed in this e-mail are the views of the 
individual sending the message, and do not necessarily reflect the views held by 
<U3:PLACE u11:st="on"><U3:PLACENAME u11:st="on"><U1:PLACE 
u2:insAuthor="Parade College" u2:insDate="2008-06-10T09:28:00Z" 
u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><U1:PLACENAME u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:place w:st="on"><st1:PlaceName 
w:st="on">Parade</U1:PLACENAME></U1:PLACE></U3:PLACENAME></st1:PlaceName></st1:place> 
<U3:PLACETYPE u11:st="on"><U1:PLACETYPE u2:insAuthor="Parade College" 
u2:insDate="2008-06-10T09:28:00Z" u2:endInsAuthor="Parade College" 
u2:endInsDate="2008-06-10T09:28:00Z"><st1:PlaceType 
w:st="on">College.</U1:PLACETYPE></U3:PLACETYPE></U3:PLACE></st1:PlaceType></SPAN></SPAN></U3:PLACE></U3:COUNTRY-REGION></DIV><br><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Brett Groves [mailto:groves.brett.g@edumail.vic.gov.au] <br><b>Sent:</b> Wednesday, 25 May 2011 11:43 AM<br><b>To:</b> Year 12 Software Development Teachers' Mailing List<br><b>Subject:</b> [Year 12 SofDev] Help needed<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>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<o:p></o:p></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>Question 12:</span></b><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>The following diagram shows the contents of an array of records used for mixing colours.</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>The name of the array is &#8216;COLOUR&#8217;.</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:7.5pt;font-family:"Garamond","serif"'>The algorithm below is used to calculate colour values, using an array.</span> <o:p></o:p></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>BEGIN</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>SET TOTAL TO 0</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>SET COUNTER TO 1</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>WHILE COUNTER &lt; 4</span><span lang=EN-US><o:p></o:p></span></p><p style='mso-margin-top-alt:5.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>TOTAL = TOTAL + COLOUR [COUNTER] . GREENVALUE</span><span lang=EN-US><o:p></o:p></span></p><p style='mso-margin-top-alt:5.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>ADD 1 TO COUNTER</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>ENDWHILE</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>WHILE COUNTER &lt; 4</span><span lang=EN-US><o:p></o:p></span></p><p style='mso-margin-top-alt:5.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>TOTAL = TOTAL + COLOUR [COUNTER] . REDVALUE</span><span lang=EN-US><o:p></o:p></span></p><p style='mso-margin-top-alt:5.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>ADD 1 TO COUNTER</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:36.0pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>ENDWHILE</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>PRINT TOTAL</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>END</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>What will be the output of this algorithm?</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>(A) 10</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>(B) 11</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>(C) 18</span><span lang=EN-US><o:p></o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt'><span lang=EN-US style='font-size:7.5pt;font-family:"Garamond","serif"'>(D) 25</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o: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.<o:p></o:p></p></div></body></html>