Repetition (Loop) Control Structure

Affiliation: UNITEN
Resolution: Group | Duration: One to two hours

Overview


Goals

To make students learn how to repeat the execution of the same code multiples times while the specified condition or criteria is fulfilled. Repetition control structure is one of the main control structure in programming beside sequence and selection structures.

Learning Objectives

By the end of this activity, students will be able to: - explain the 3 kinds repetition control structures - while, do while and for - explain the counter-controlled and sentinel-controlled repetition structure - apply the concepts of repetition control structure into a practical problem

Context

In programming, there are many situations in which it is necessary to repeat the execution of a set of statements. There are three looping (repetition) structures: while, for, and do…while. It allows repeating statements over and over until certain conditions are met. Using this construct of programming, programmers do not need to write the same set of statements multiple times.