Examples of the two types of loops
Event-controlled loop
Trailer logic pattern
priming read/input while (event hasn't happened) { process the data received read/input }
common errors with an event-controlled loop
Counter-controlled loop
Counter pattern
set counter to initial value while (counter relation limit) { process data as needed increment (decrement) the counter }
common errors with a counter-controlled loop