5.15 Wrap-Up

This chapter presented basic problem-solving techniques that you’ll use in building classes and developing methods for these classes. We demonstrated how to construct an algorithm, then how to refine the algorithm through several phases of pseudocode development, resulting in C# code that can be executed as part of a method. The chapter showed how to use top-down, stepwise refinement to plan out the specific actions that a method must perform and the order in which the method must perform these actions.

Only three types of control statements—sequence, selection and iteration—are needed to develop any algorithm. Specifically, we demonstrated the if and ifelse selection statements and the while iteration statement. These are some of the building blocks used to construct apps. We used control-statement stacking to compute the total and the average of a set of student grades with counter- and sentinel-controlled iteration, and we used control-statement nesting to analyze and make decisions based on a set of exam results. We introduced C#’s compound assignment, unary cast, conditional (?:), increment and decrement operators. Finally, we discussed the simple types. In Chapter 6, we continue our discussion of control statements, introducing the for, dowhile and switch statements.

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

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