<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@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:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.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 lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Thanks Alan/James<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Damien</span></b><b><span style="font-family:"Arial","sans-serif";color:black">
</span></b><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Atkinson-Buck</span></b><span style="font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Head of Learning Area: Technology/Arts</span><span style="font-family:"Arial","sans-serif";color:black"> </span><span style="font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-family:"Arial","sans-serif";color:#1F497D"><img width="750" height="2" id="_x0000_i1026" src="cid:image001.png@01CFE34E.60D611F0"></span><span style="font-family:"Arial","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="color:#1F497D"><img width="189" height="66" id="_x0000_i1025" src="cid:image002.jpg@01CFE34E.60D611F0"></span><span style="color:#1F497D"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">p:</span></b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> +61 3 9490 3848
</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">e:</span></b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">
<a href="mailto:damien.atkinson-buck@ivanhoe.com.au">damien.atkinson-buck@ivanhoe.com.au</a></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D">
<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">f:</span></b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> +61 3 9490 3490</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">w:</span></b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D">
<a href="http://www.ivanhoe.com.au/">www.ivanhoe.com.au</a><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">w:</span></b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D">
<a href="http://www.ivanhoe100.com.au/">www.ivanhoe100.com.au</a><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<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"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> alan whittaker [mailto:awhittaker@netspace.net.au]
<br>
<b>Sent:</b> Wednesday, 8 October 2014 10:08 PM<br>
<b>To:</b> Year 12 Software Development Teachers' Mailing List<br>
<b>Subject:</b> Re: [Year 12 SofDev] DLTV Exam 1<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hello there,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think the issue is the Mod keyword in your VB code (somewhere around line 10). The pseudocode does state a "Mod()" function but I don't think it should be there (in other words I don't know what it is meant to do).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Mod gives you the remainder when the left number is divided by the one on the right,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">therefore, no matter the values of low and high, this will always give you a value of 0 or 1 (when dividing by 2), which would explain your infinite loop.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">ie: (1 + 999) Mod 2 = 1000 Mod 2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> = 0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-tab-span"> </span>as the remainder when 1000 is divided by 2 is 0.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Given that Mod can only give you two values, your loop will never end as StudentNo(0) = 1 and StudentNo(1) = 125, neither of which are the searchnum.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Instead of finding the modulus of low + high, just dividing it by 2 will give the middle number between low and high, and I think will fix the loop.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hope this helps<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">James son of an aging, once-an-IT-teacher, Alan Whittaker (Kept him off the games for a while)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On 08/10/2014, at 5:50 PM, ATKINSON-BUCK, Damien wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hi folks,</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> I’m just going through the DLTV Exam and can’t quite figure the answer to the algorithm question 12 below.</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><image002.png><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><image003.png><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">My desk produces,</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border-width:initial;border-color:initial">
<tbody>
<tr>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Pass</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Middle</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Low</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">High</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Result</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.95pt;border:solid windowtext 1.0pt;border-left:none;padding:0cm 5.4pt 0cm 5.4pt;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">StudentNo(Middle)</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">0</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">999</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">False</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.95pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">2</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">0</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">999</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">False</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.95pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">125</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">3</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">0</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">999</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">False</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.95pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width="128" valign="top" style="width:95.75pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">4</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">0</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">999</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.75pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">False</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td width="128" valign="top" style="width:95.95pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial;border-left-width:initial;border-left-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">125</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td width="766" colspan="6" valign="top" style="width:574.7pt;border:solid windowtext 1.0pt;border-top:none;padding:0cm 5.4pt 0cm 5.4pt;border-top-width:initial;border-top-color:initial">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">AND SO ON</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I’ve tried it as vb code below and ended in an infinite loop. Am I missing something blatantly obvious here or can anyone see the fix for this?</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:blue">Module</span><span class="apple-converted-space"><span style="font-size:9.5pt;font-family:Consolas"> </span></span><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">Module1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>StudentNo()<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Integer</span><span class="apple-converted-space"> </span>=
{1, 125, 250, 375, 500, 625, 750, 875, 999}</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Sub</span><span class="apple-converted-space"> </span>Main()</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>low<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Integer</span><span class="apple-converted-space"> </span>=
1</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>high<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Integer</span><span class="apple-converted-space"> </span>=
999</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>result<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Boolean</span><span class="apple-converted-space"> </span>=<span class="apple-converted-space"> </span><span style="color:blue">False</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>searchnum<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Integer</span><span class="apple-converted-space"> </span>=
375</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Do</span><span class="apple-converted-space"> </span><span style="color:blue">While</span><span class="apple-converted-space"> </span>low
<= high<span class="apple-converted-space"> </span><span style="color:blue">And</span><span class="apple-converted-space"> </span>result =<span class="apple-converted-space"> </span><span style="color:blue">False</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>middle<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">Integer</span><span class="apple-converted-space"> </span>=
(low + high)<span class="apple-converted-space"> </span><span style="color:blue">Mod</span><span class="apple-converted-space"> </span>2</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">If</span><span class="apple-converted-space"> </span>StudentNo(middle) = searchnum<span class="apple-converted-space"> </span><span style="color:blue">Then</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> result =<span class="apple-converted-space"> </span><span style="color:blue">True</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Dim</span><span class="apple-converted-space"> </span>myMessage<span class="apple-converted-space"> </span><span style="color:blue">As</span><span class="apple-converted-space"> </span><span style="color:blue">String</span><span class="apple-converted-space"> </span>=<span class="apple-converted-space"> </span><span style="color:#A31515">"Low
"</span><span class="apple-converted-space"> </span>& low &<span class="apple-converted-space"> </span><span style="color:#A31515">", High "</span><span class="apple-converted-space"> </span>& high &<span class="apple-converted-space"> </span><span style="color:#A31515">",
Mid "</span><span class="apple-converted-space"> </span>& middle</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> MsgBox(myMessage, vbOK,<span class="apple-converted-space"> </span><span style="color:#A31515">"DONE"</span>)</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">End</span><span class="apple-converted-space"> </span><span style="color:blue">If</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span style="color:blue">If</span><span class="apple-converted-space"> </span>StudentNo(middle) > searchnum<span class="apple-converted-space"> </span><span style="color:blue">Then</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> high = middle</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Else</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> low = middle</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">End</span><span class="apple-converted-space"> </span><span style="color:blue">If</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">Loop</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> <span class="apple-converted-space"> </span><span style="color:blue">End</span><span class="apple-converted-space"> </span><span style="color:blue">Sub</span></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas"> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:blue">End</span><span class="apple-converted-space"><span style="font-size:9.5pt;font-family:Consolas"> </span></span><span style="font-size:9.5pt;font-family:Consolas;color:blue">Module</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:9.0pt;color:#880231"> </span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:9.0pt;color:#880231"> </span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:9.0pt;color:#880231"><br>
</span></b><b><span style="font-family:"Arial","sans-serif";color:#82002C">Damien</span></b><span class="apple-converted-space"><b><span style="font-size:9.0pt;color:#880231"> </span></b></span><b><span style="font-family:"Arial","sans-serif";color:#880231">Atkinson-Buck</span></b><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Head of Learning Area: Technology/Arts</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt 36.0pt .75pt .75pt">
<div>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">p:</span></b><span class="apple-converted-space"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> </span></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">+61
3 9490 3848</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td style="padding:.75pt 36.0pt .75pt .75pt">
<div>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">e:</span></b><span class="apple-converted-space"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> </span></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"><a href="mailto:damien.atkinson-buck@ivanhoe.com.au">damien.atkinson-buck@ivanhoe.com.au</a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<div>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Arial","sans-serif""> </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<div>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">f:</span></b><span class="apple-converted-space"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> </span></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">+61
3 9490 3490</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<div>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">w:</span></b><span class="apple-converted-space"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> </span></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif""><a href="http://www.ivanhoe.com.au/"><span style="color:black">www.ivanhoe.com.au</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<div>
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black">w:</span></b><span class="apple-converted-space"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"> </span></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif""><a href="http://www.ivanhoe100.com.au/"><span style="color:black">www.ivanhoe100.com.au</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal"><image001.jpg><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Please consider the environment before printing this e-mail.</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif""><br>
<br>
<br>
<br>
Privacy, Virus and Copyright Warning<br>
<br>
The information contained in this electronic message (e-mail), and any files transmitted with it:<br>
<br>
* is intended for the named recipients only. If you have received this in error, please advise the sender and delete it and any copies immediately;<br>
* Any personal information in this email must be used in accordance with the Privacy Act 1988 and this always applies even if it has been sent to you in error.<br>
* represents the views of the sender and does not necessarily represent the views or formal advice of Ivanhoe Grammar School;<br>
* may be subject to Copyright, so no further use should be made of it without the author's permission.<br>
<br>
The School does not represent or warrant that the email or any files attached do not contain errors or are free from computer viruses or other defects nor does it accept responsibility for any loss or damage resulting directly or indirectly from the use of
the email or any attached files. _______________________________________________<br>
<a href="http://www.edulists.com.au/">http://www.edulists.com.au</a><span class="apple-converted-space"> </span>- FAQ, Subscribe, Unsubscribe<br>
IT Software Development Mailing List kindly supported by<br>
<a href="http://www.vcaa.vic.edu.au/">http://www.vcaa.vic.edu.au</a><span class="apple-converted-space"> </span>- Victorian Curriculum and Assessment Authority and<br>
<a 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><span class="apple-converted-space"> </span><br>
<a href="http://www.vitta.org.au/">http://www.vitta.org.au</a><span class="apple-converted-space"> </span> - VITTA Victorian Information Technology Teachers Association Inc<br>
<a href="http://www.swinburne.edu.au/ict/schools">http://www.swinburne.edu.au/ict/schools</a><span class="apple-converted-space"> </span>- Swinburne University<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<br>
<br>
<br>
Privacy, Virus and Copyright Warning<br>
<br>
The information contained in this electronic message (e-mail), and any files transmitted with it:<br>
<br>
* is intended for the named recipients only. If you have received this in error, please advise the sender and delete it and any copies immediately;<br>
* Any personal information in this email must be used in accordance with the Privacy Act 1988 and this always applies even if it has been sent to you in error.<br>
* represents the views of the sender and does not necessarily represent the views or formal advice of Ivanhoe Grammar School;<br>
* may be subject to Copyright, so no further use should be made of it without the author's permission.<br>
<br>
The School does not represent or warrant that the email or any files attached do not contain errors or are free from computer viruses or other defects nor does it accept responsibility for any loss or damage resulting directly or indirectly from the use of
the email or any attached files.
</body>
</html>