Zebra0

Learn to Program Step-by-Step

Control Structures

Most programming languages use 3 basic control structures:

  • Sequence: statements are executed one after the other.
  • Selection or branching: One statement or group of statements is executed if a Boolean expression is true, another (optional) statement or group of statements is executed if the Boolean expression is false.
  • Iteration or looping: One statement or group of statements is executed repeatedly until some exit condition is met.

In programming languages where there is a graphical user interface (GUI) the program will repeatedly "listen" for events to occur. When an event occurs a function is executed in response to that event. Events include things such as a file finishes loading, the user clicks a button, moves the mouse or types a key.

These types of programs are called event driven programs.

Like us on Facebook:


OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: April 14 2016 14:30:34.