Share Your Experience: Take the 2024 Developer Survey

# Questions tagged [looping]

Use this tag for questions related to teaching and learning the various forms of repetition in computer programming. Tradeoffs between the various semantic forms can be discussed. This tag is not appropriate for specific recursion questions, though questions relating to comparison of recursive vs repetitive solutions might be.

10 questions
Filter by
Sorted by
Tagged with
271 views

### For and while loops examples for 12-13 years old class

I teach in a secondary, first grade, school in Italy. The kids are 13 years old, on last year before second grade. I am teaching them the very basic of programming. Last year we did some flowcharts ...
• 51
720 views

### What are good, practical labs and activities for loops?

I am teaching some high school students, also the first time programmers, some basic programming concepts and applications. When introducing loop I find that using it to check prime number (and find ...
• 868
2k views

### Order to teach looping constructs in a non ideal language

In an ideal teaching language If the language directly supports them then the order to teach looping constructs seems simple. Infinite loop: forever. Simple finite ...
• 10.7k
289 views

### Pedagogical reasoning behind a minor difference in two loops

I keep seeing examples like the first program bellow, in teaching materials. Is there a pedagogical reason to teach this first program, compared to the second? ...
• 10.7k
455 views

### Single-dimensional array and simple looping activities of significance

I give a lab on single-dimensional loops and arrays. By "single dimensional loops", I mean that there is no nesting of loops. (I will later give a second lab on multi-dimensional loops and arrays, ...
• 33.7k
391 views

### Using physical activity to explain the nested for loop

I have been rewriting my unit on nested for loops for AP Computer Science (thus, we are using Java). I would like to use some sort of physical activity to drive home the differences between roughly ...
• 33.7k
2k views

### Example for For vs While Loop (in Java)

I'm looking for a set of concrete examples that illustrates good use cases of using a for vs a while loop for beginners. I feel ...
• 429
1k views

### Teaching the tradeoffs of the foreach loop

Edit: It's been quite a while since I posted this question, and in the intervening time, I have come to love the foreach loop. However, in order to avoid invalidating answers, I leave the text ...
• 33.7k
7k views

### Teaching the humble for loop

So, in C-style languages, the for loop has a funny little syntax: for (int i = 0; i < 100; i++) { // do something } If ...
• 33.7k