About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning of each presentation. You may customize the presentations to fit your class needs. Some figures from the chapters are included. A complete set of images from the book can be found on the Instructor Resources disc.
Chapter 1 I Am Not a Control Freak! (Control Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition
Objectives Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 3 After studying Chapter 1, you should be able to: Describe the three control structures Write simple algorithms using the sequence, selection, and repetition structures
Control Structures Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 4 Control structures Sequence, selection, and repetition Control the flow of a program’s logic All programs use the sequence structure Most programs Will use both selection and repetition structures
The Sequence Structure Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 5 Directs computer to process program instructions in a particular order Example: Rob, the mechanical man Has a limited instruction set Algorithm Set of step-by-step instructions that accomplish a task
The Sequence Structure (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 6 Figure 1-1 An example of the sequence structure
The Selection Structure Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 7 Also called the decision structure Makes a decision and then takes appropriate action based on that decision Used every time you drive your car and approach a railroad crossing
The Selection Structure (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 8 Figure 1-2 An example of the selection structure
The Repetition Structure Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 9 Directs computer to repeat one or more instructions until some condition is met Also referred to as a loop or an iteration
The Repetition Structure (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 10 Figure 1-3 An example of the repetition structure
Summary Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 11 Algorithm Set of step-by-step instructions that accomplish a task Control structures Sequence, selection, and repetition Also called logic structures Sequence structure Directs computer to process program instructions one after another Used in all programs
Summary (cont’d.) Clearly Visual Basic: Programming with Visual Basic 2010, 2 nd Edition 12 Selection structure Directs computer to make a decision and then selects appropriate action to take Repetition structure Directs computer to repeat one or more program instructions until some condition is met