Module 5: Programming, Logic, Loops, Selection Statement/Intro

I ntroducing

the basic programming statements. The usefulness of a computer program comes from the programmer's ability to identify tasks that need to be done repeatedly. Instead of a long list of things to do, i.e. individual statements, the programmer is able to identify the fundamental tasks to accomplish and use a logical construct to contruct how often, or how many, or precisely which task is to be accomplished.

Goals of this module:

  1. Introduce Logical Operators
  2. Introduce Repetition Statements
    for loop
    When you know ahead of time how many time you want to repeat a sequence of commands. This construction can count for you.
    while loop
    When you know ahead of time that some condition will occur that can be tested. It is crucial that you know that this condition will be satisfied to avoid a loop that runs forever (an infinite loop
  3. Introduction Selection Statement
    if end
    if else end
    if elseif else end
    switch case end
    This construction is not covered in our text, but I feel it belongs in this list of statements.

Page author: Dr. Kris Stewart
URL: http://www.stewart.cs.sdsu.edu/cs205/module5/Intro.html
Last updated: Feb. 23, 1998