6.13 Wrap-Up

Chapter 5 discussed the if, ifelse and while control statements. In Chapter 6, we discussed the for, do...while and switch control statements. (We’ll discuss the foreach statement in Chapter 8.) You learned that any algorithm can be developed using combinations of sequence (i.e., statements listed in the order in which they should execute), the three selection statements—if, ifelse and switch —and the four iteration statements—while, dowhile, for and foreach. You saw that the for and dowhile statements are simply more convenient ways to express certain types of iteration. Similarly, we showed that the switch statement is a convenient notation for multiple selection, rather than using nested if...else statements. We discussed how you can combine various control statements by stacking and nesting them. We showed how to use the break and continue statements to alter the flow of control in iteration statements. You learned about the logical operators, which enable you to use more complex conditional expressions in control statements. In Chapter 7, we examine methods in greater depth.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset