While Loops
explain while loop
- simple example
Compare to for loop
- for loops are a coding shortcut for a while loop with a counter
- examples
- loop forever until exit condition
- exit condition needs to be known in advance
- explain exactly when the loop exits
while using arrays
- simple array example
- using a boolean
- (possibly using the result of a method call)
do.. while
- explain
- difference to while loop
- using arrays
- danger of always doing one iteration
big example
Friday, 14 November 2008
Sunday, 9 November 2008
Chunk 13 Description
CHUNK 13
TITLE While statements
DESCRIPTION Describe the two forms of while statement. Students really find this a tough topic so go very gently with lots of examples. Use arrays as much as possible but start of with a simple non-array example such as summing the first n integers. Develop a program similar to Greenberg 90--92
OUTCOMES
HINT This probably the toughest part of the book so far, take it very gently with lots of small examples between three and five lines of code
PROGRAM Develop a program similar to the one you describe in the text.
TITLE While statements
DESCRIPTION Describe the two forms of while statement. Students really find this a tough topic so go very gently with lots of examples. Use arrays as much as possible but start of with a simple non-array example such as summing the first n integers. Develop a program similar to Greenberg 90--92
OUTCOMES
- Be able to understand a simple while loop involving a single dimensional array
- Be able to develop a simple while loop involving a single dimensional array
- Be able to understand a program of a similar complexity to that described in your text
HINT This probably the toughest part of the book so far, take it very gently with lots of small examples between three and five lines of code
PROGRAM Develop a program similar to the one you describe in the text.
Monday, 3 November 2008
Book arrived and chunk order
The processing book finally arrived so I can finally start playing with the IDE. As I'm doing 2 chunks (13 and 82) I've decided to do chunk 82 first, as it looks like fun. The chunk 82 blog is here:
http://masswritingchunk82.blogspot.com/
http://masswritingchunk82.blogspot.com/
Subscribe to:
Posts (Atom)