Difference between revisions of "Loops"

From CompSciWiki
Jump to: navigation, search
(Test Conditions)
(An Introduction)
Line 1: Line 1:
==An Introduction==
+
==TO DO LIST (in any order)==
'''TO DO LIST (in any order):'''
+
 
* Discuss WHAT a loop is. (Definition)
 
* Discuss WHAT a loop is. (Definition)
 
* Types: while, for, do, etc...
 
* Types: while, for, do, etc...
Line 8: Line 7:
 
** Condition (basic definition because we have a section below)
 
** Condition (basic definition because we have a section below)
 
** etc...
 
** etc...
 +
 +
 +
==An Introduction==
 +
A loop is a control structure that repeatedly executes a body of code as long as a [[test condition]] evaluates to true.
  
 
==Types of Loops==
 
==Types of Loops==

Revision as of 17:31, 4 March 2007

TO DO LIST (in any order)

  • Discuss WHAT a loop is. (Definition)
  • Types: while, for, do, etc...
  • Bottom tested, top tested
  • Terms:
    • Initializing
    • Condition (basic definition because we have a section below)
    • etc...


An Introduction

A loop is a control structure that repeatedly executes a body of code as long as a test condition evaluates to true.

Types of Loops

Scope

Infinite Loops

Additional Information

  • more on loops
    • multiple statements in the Initialization and Update
    • brief explanation of do-while loops (and why bottom testing loops are not ideal)
    • Running Totals and Sentinel Values
    • Review Questions and Exercises