[Year 12 SofDev] Re: SD VITTA exam 2, multichoice #1

Timmer-Arends timmer at melbpc.org.au
Wed Oct 17 17:52:38 EST 2007


I know it's pedantic but I'm going to write it anyway:

Kevin wrote:
All programs can be written using these very simple constructs.
1. Sequence 
2. Repetition (aka iteration or Loops) 
3. Conditional Branching 
4. Combined Branching and Repetition 

Actually only three basic constructs are required to write any program: 1, 2 and 3.
4 is composed of two basic constructs (ie 2 and 3)

And Frank wrote:
The following implementation of a while loop that Mark Kelly found the other day, which is actually a Repeat..Until loop in your theoretical sense but using different key words, says it all....
Do
..
Loop While <condition>

This loop is subly different from a Repeat..Until (and as far as I know only available in MS versions of BASIC). It will execute the body once and then after only WHILE the condition IS TRUE. A Repeat..Until executes the body once and then continues looping UNTIL the condition BECOMES TRUE.

Personally, I don't think the post-test WHILE (or MS xxxBASIC's pre-test UNTIL) ought ever be shown to students! 

Regards
Robert T-A
Brighton SC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20071017/55074c7a/attachment.html


More information about the sofdev mailing list