Summary of Control Statements in C++
C++ has only three kinds of control structures, which from this point forward we refer to as control statements: the sequence statement, selection statements (three types—
switch) and repetition statements (three types—
while). Each program combines as many of each of these control statements as appropriate for the algorithm the program implements. We can model each control statement as an activity diagram with initial and final states representing that control statement’s entry and exit points, respectively. These single-entry/single-exit control statements make it easy to build programs—control statements are attached to one another by connecting the exit point of one ...