Selection Control and Repetition Control Structure

Authors Avatar

Selection and Repetition Control Structure  

Selection Control and Repetition Control Structure

University of Phoenix

Mayada Set

        PRG/210        

Fundamental of Programming with Algorithm and Logics

Instructor Name: Guillermo A. Hernandez

Date: May 15, 2009

Before writing a program to solve a problem, we must have a thorough understanding of the problem and a carefully planned approach to solving it. When writing a program, we must also understand the types of building blocks that are available and employ proven program construction techniques. A computer can process a program in one of three ways: in sequence; selectively by making a choice, which is also called a branch; or repetitively by executing a statement over and over, using a structure called a loop. Control structures provide alternatives to sequential program execution and are used to alter the sequential flow of execution. The two most common control structures are selection and repetition. In selection, the program executes particular statements depending on some condition(s). In repetition, the program repeats particular statements a certain number of times depending on some condition(s).

        Four types of selection control structure are simple selection, simple selection with null false branch, combine selection and nested selection.

Join now!
  • Simple selection control structure is easy to understand and self-defining.  The whole statement is base on a condition and its veracity.  When the statement or "test" is found to be true, a statement is executed, and if it is false, another test is given or the program continues to the next block. The structure is represented in pseudocode using the keywords IF, THEN, ELSE and ENDIF.
  • Simple selection with null false branch is a variation of the simple IF structure. It is used when a task is performed only when a particular condition is true. If the condition is ...

This is a preview of the whole essay