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

Frank Van Den Boom vandenboomfj at aquinas.vic.edu.au
Wed Oct 17 09:45:26 EST 2007


Kevin
The way you describe it matches the theory I have seen over the years. However, the implementation of these constructs takes all forms. For example, I don't think VB.NET will traverse a FOR..NEXT loop even once if the start>finish, whereas I have used other versions of Basic in the past that had to traverse it at least once.
 
The following implementation of a 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>
 
Frank

	-----Original Message----- 
	From: sofdev-bounces at edulists.com.au on behalf of Kevin Feely 
	Sent: Wed 17-Oct-07 9:29 AM 
	To: Year 12 Software Development Teachers' Mailing List 
	Cc: 
	Subject: Re: [Year 12 SofDev] Re: SD VITTA exam 2, multichoice #1
	
	
	Hi Mark,
	For i= 1 to ... will set i to 1 and you will get at least 1 loop. for-next cannot be written (and why would you) so that you do not get the loop at least once..
	For next is an iteration construct
	The other 2 are conditional branching constructs
	
	So logically for-next is not a test but an iteration control - the other 2 are branching controls DESIGNED for testing. One when you will need to loop at least once, and the other in cases when the loop may not need to not execute at all.
	What do we have .......the 4 main programming constructs ...
	

	*	Sequence .... a series of line of code 
		
	*	Repetition (aka iteration or Loops) - where you would use for next or whatever the program uses for iterations
		
	*	Conditional Branching 
	*	Combined Branching and Repetition 

		*	Conditional test at start of the construct - the "while-do" 
			
		*	Conditional test at the end of the construct - the "repeat-until"
			

	(taken from http://www.tutorials4u.com/c/loopsdecisions.htm)
	
	Mark Kelly wrote: 

		Ah, but FOR..NEXT does test whether the index is beyond the specified boundaries. 
		
		e.g. FOR i = 1 to 5 
		
		is an implicit pre-test for i>5. 
		
		Cheers 
		Mark 
		
		Kevin Feely wrote: 
		

			Hi All, 
			I would approach the question with - is their a value for which this loop would NOT execute? 
			If it is a pre test condition then you will not get any processing from the lines within the loop, if it is a post test condition then the loop will execute AT LEAST ONCE. 
			Also i (that is me myself I mwa) accept that the logic of a do-while loop is to test the condition before the loop starts, and the repeat-until loop tests at the end of the loop (the construct within a language will vary BUT in generic terms i accept this "standard"), even though  the ACTUAL  written algorithm on the question is not perfect ( I suppose thats hard to do unless you write it in 9 diiferent languages, but then again it is supposed to be in pcode format and therefore language independent) 
			Also the for-next answer seems to be a bit of a distraction as it does not TEST for anything, it will simply loop as many times as you want, via a variable used as a counter,  and this could be from 0 times to a big number. 
			So i would think the expected answer was A 
			regards 
			kev 
			
			
			Sonia Cotugno wrote: 
			

				I agree with you Mark. 
				  
				I answered with (C) For...Next because none of the others tested at the top of the loop. I think it's actually incorrect to say Do...While. I really do think it should have said While as an option. 
				  
				Regards, 
				Sonia Cotugno 
				  
				  
				Brighton Grammar School 
				90 Outer Cres 
				Brighton VIC 3186 
				(03) 8591 2200 
				www.brightongrammar.vic.edu.au <http://www.brightongrammar.vic.edu.au/>  <http://www.brightongrammar.vic.edu.au> <http://www.brightongrammar.vic.edu.au/>  
				  
				  
				
				------------------------------------------------------------------------ 
				*From:* sofdev-bounces at edulists.com.au on behalf of sofdev-request at edulists.com.au 
				*Sent:* Fri 10/12/2007 12:00 PM 
				*To:* sofdev at edulists.com.au 
				*Subject:* sofdev Digest, Vol 32, Issue 8 [Scanned] 
				
				Send sofdev mailing list submissions to 
				        sofdev at edulists.com.au 
				
				To subscribe or unsubscribe via the World Wide Web, visit 
				        http://www.edulists.com.au/mailman/listinfo/sofdev 
				or, via email, send a message with subject or body 'help' to 
				        sofdev-request at edulists.com.au 
				
				You can reach the person managing the list at 
				        sofdev-owner at edulists.com.au 
				
				When replying, please edit your Subject line so it is more specific 
				than "Re: Contents of sofdev digest..." 
				
				
				Today's Topics: 
				
				   1. SD VITTA exam 2, multichoice #1 (Mark Kelly) 
				
				
				---------------------------------------------------------------------- 
				
				Message: 1 
				Date: Fri, 12 Oct 2007 11:59:09 +1000 
				From: Mark Kelly <kel at mckinnonsc.vic.edu.au> <mailto:kel at mckinnonsc.vic.edu.au>  
				Subject: [Year 12 SofDev] SD VITTA exam 2, multichoice #1 
				To: "Year 12 Software Development Teachers' Mailing List" 
				        <sofdev at edulists.com.au> <mailto:sofdev at edulists.com.au>  
				Message-ID: <470ED4ED.3020009 at mckinnonsc.vic.edu.au> <mailto:470ED4ED.3020009 at mckinnonsc.vic.edu.au>  
				Content-Type: text/plain; charset=ISO-8859-1; format=flowed 
				
				I'm curious what others think... 
				
				"Testing at the 'top of the loop' is performed by which syntax in 
				pseudo-code? 
				
				A. Do..While 
				B. Do..Until 
				C. For..Next 
				D. EOF" 
				
				The suggested answer given is A, with the explanation that 'Do..Until is 
				often referred to as testing at the bottom of the loop...' 
				
				But surely both do..while and do..until both test at the bottom of the loop. 
				
				A While..Wend, on the other hand, tests at the top. 
				
				-- 
				
				Mark Kelly 
				Manager - Information Systems 
				McKinnon Secondary College 
				McKinnon Rd McKinnon 3204, Victoria, Australia 
				Direct line / Voicemail: 8520 9085 
				School Phone +613 8520 9000 
				School Fax +613 95789253 
				kel AT mckinnonsc.vic.edu.au 
				
				Webmaster - http://www.mckinnonsc.vic.edu.au <http://www.mckinnonsc.vic.edu.au/>  <http://www.mckinnonsc.vic.edu.au/> <http://www.mckinnonsc.vic.edu.au/>  
				IT Lecture notes: http://vceit.com <http://vceit.com/>  <http://vceit.com/> <http://vceit.com/>  
				Moderator: IT Applications Mailing List 
				
				You'll know when we are officially a civilised race: our schools have 
				all the money they need and the Air Force has to run a chook raffle to 
				buy a new bomber. 
				
				
				
				------------------------------ 
				
				_______________________________________________ 
				sofdev mailing list 
				sofdev at edulists.com.au 
				http://www.edulists.com.au/mailman/listinfo/sofdev 
				
				
				End of sofdev Digest, Vol 32, Issue 8 
				************************************* 
				
				


			Important - 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. 
			_______________________________________________ 
			http://www.edulists.com.au <http://www.edulists.com.au/>  
			IT Software Development Mailing List kindly supported by 
			http://www.vcaa.vic.edu.au <http://www.vcaa.vic.edu.au/>  - Victorian Curriculum and Assessment Authority and 
			http://www.vitta.org.au/vce/studies/infotech/softwaredevel3-4.html  - VITTA Victorian Information Technology Teachers Association Inc 
			
			
			


	

	Important - 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.

	_______________________________________________ 
	http://www.edulists.com.au <http://www.edulists.com.au/> IT Software Development Mailing List kindly supported by 
	http://www.vitta.org.au/vce/studies/infotech/softwaredevel3-4.html - Victorian Curriculum and Assessment Authority and 
	http://www.vitta.org.au <http://www.vitta.org.au/> - VITTA Victorian Information Technology Teachers Association Inc 


This email and any attachments may be confidential. If you are not the intended recipient, you must not disclose 
or use the information in this mail. If received in error, please notify the sender or the College immediately 
and delete the email and all copies. The College does not guarantee that this email is virus or error free. 
Any attached files 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. The content and opinions in this email are not necessarily those of the College.
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 11906 bytes
Desc: not available
Url : http://www.edulists.com.au/pipermail/sofdev/attachments/20071017/42eabd88/attachment-0001.bin


More information about the sofdev mailing list