The Visual Basic PAL is designed to be paired with the Sixth Edition of Joyce Farrell's Programming Logic and Design text. Together, the two books provide the perfect opportunity to learn the fundamentals of programming while gaining exposure to an actual programming language. Readers can discover how real Visual Basic code behaves within the context of the traditional language-independent logic and design course.
Author(s): Jo Ann Smith
Edition: 3
Publisher: Cengage Learning
Year: 2010
Language: English
Pages: 219
Cover Page
......Page 1
Title Page......Page 2
Copyright Page......Page 3
Brief Contents......Page 4
Preface......Page 12
Contents......Page 5
CHAPTER 1: An Introduction to Visual Basic and the Visual Basic Programming Environment......Page 20
Three Types of Visual Basic Programs......Page 21
An Introduction to Object-Oriented Terminology......Page 22
The Structure of a Visual Basic Program......Page 24
The Visual Basic Development Cycle......Page 25
Compiling a Visual Basic Program......Page 26
Executing a Visual Basic Program......Page 28
LAB 1.1 Compiling and Executing a Visual Basic Program......Page 29
CHAPTER 2: Variables, Constants, Operators, and Writing Programs Using Sequential Statements......Page 30
Variable Names......Page 31
Visual Basic Data Types......Page 32
Declaring and Initializing Variables......Page 33
Exercise 2-2: Declaring and Initializing Visual Basic Variables......Page 34
LAB 2.1 Declaring and Initializing Visual Basic Variables......Page 35
Named Constants......Page 36
LAB 2.2 Declaring and Initializing Visual Basic Constants......Page 37
Arithmetic Operators......Page 38
Assignment Operators and the Assignment Statement......Page 39
Precedence and Associativity......Page 40
Exercise 2-4: Understanding Operator Precedence and Associativity......Page 41
LAB 2.3 Arithmetic and Assignment Operators......Page 42
Sequential Statements, Comments, and Interactive Input Statements......Page 43
Exercise 2-5: Understanding Sequential Statements......Page 47
LAB 2.4 Using Sequential Statements in a Visual Basic Program......Page 48
CHAPTER 3: Writing Structured Visual Basic Programs......Page 50
Using Flowcharts and Pseudocode to Write a Visual Basic Program......Page 51
LAB 3.1 Using Flowcharts and Pseudocode to Write a Visual Basic Program......Page 55
Writing a Modular Program in Visual Basic......Page 57
LAB 3.2 Writing a Modular Program in Visual Basic......Page 64
CHAPTER 4: Writing Programs that Make Decisions......Page 65
Comparison Operators......Page 66
Logical Operators......Page 67
Comparison and Logical Operator Precedence and Associativity......Page 68
Comparing Strings......Page 71
Decision Statements......Page 72
The If Statement......Page 73
Exercise 4-1: Understanding If Statements......Page 74
LAB 4.1 Using If Statements......Page 75
The If Then Else Statement......Page 76
Exercise 4-2: Understanding If Then Else Statements......Page 77
LAB 4.2 Using If Then Else Statements......Page 79
Exercise 4-3: Understanding Nested If Statements......Page 81
LAB 4.3 Using Nested If Statements......Page 82
The Select Case Statement......Page 83
LAB 4.4 Using a Select Case Statement......Page 86
Using Decision Statements to Make Multiple Comparisons......Page 87
Using OR Logic......Page 88
Exercise 4-5: Making Multiple Comparisons in Decision Statements......Page 89
LAB 4.5 Making Multiple Comparisons in Decision Statements......Page 91
CHAPTER 5: Writing Programs Using Loops......Page 93
Writing a Do While Loop in Visual Basic......Page 94
Exercise 5-1: Using a Do While Loop......Page 95
Using a Counter to Control a Loop......Page 96
LAB 5.1 Using a Counter-Controlled Do While Loop......Page 97
Using a Sentinel Value to Control a Loop......Page 98
LAB 5.2 Using a Sentinel Value to Control a Do While Loop......Page 100
Writing a For Loop in Visual Basic......Page 101
LAB 5.3 Using a For Loop......Page 103
Writing a Do Until Loop in Visual Basic......Page 104
LAB 5.4 Using a Do Until Loop......Page 105
Nesting Loops......Page 106
LAB 5.5 Nesting Loops......Page 107
Accumulating Totals in a Loop......Page 108
Exercise 5-7: Accumulating Totals in a Loop......Page 110
LAB 5.6 Accumulating Totals in a Loop......Page 111
Using a Loop to Validate Input......Page 112
Exercise 5-8: Validating User Input......Page 113
LAB 5.7 Validating User Input......Page 114
CHAPTER 6: Using Arrays in Visual Basic Programs......Page 115
Declaring Arrays......Page 116
Initializing Arrays......Page 117
Staying Within the Bounds of an Array......Page 118
Using Constants with Arrays......Page 119
Exercise 6-1: Array Basics......Page 120
Searching an Array for an Exact Match......Page 121
Exercise 6-2: Searching an Array for an Exact Match......Page 124
LAB 6.2 Searching an Array for an Exact Match......Page 125
Parallel Arrays......Page 126
Exercise 6-3: Parallel Arrays......Page 129
LAB 6.3 Parallel Arrays......Page 130
CHAPTER 7: File Handling and Applications......Page 131
Opening a File for Reading......Page 132
Reading Data Using a Loop and EOF......Page 133
Writing Data to an Output File......Page 134
Exercise 7-1: Opening Files and Performing File Input......Page 136
LAB 7.1 Using an Input File......Page 137
Understanding Sequential Files and Control Break Logic......Page 138
Exercise 7-2: Accumulating Totals in Single-Level Control Break Programs......Page 143
LAB 7.2 Accumulating Totals in Single-Level Control Break Programs......Page 144
CHAPTER 8: Advanced Array Techniques......Page 146
Sorting Data......Page 147
Exercise 8-1: Swapping Values......Page 148
Using a Bubble Sort......Page 149
The Main() Procedure......Page 153
The fillArray() Procedure......Page 154
The sortArray() Procedure......Page 155
Exercise 8-2: Using a Bubble Sort......Page 156
LAB 8.2 Using a Bubble Sort......Page 157
Using Multidimensional Arrays......Page 158
LAB 8.3 Using Multidimensional Arrays......Page 161
CHAPTER 9: Advanced Modularization Techniques......Page 163
Writing Procedures with No Parameters......Page 164
Exercise 9-1: Writing Procedures with No Parameters......Page 166
Writing Procedures that Require a Single Parameter......Page 167
Exercise 9-2: Writing Procedures that Require a Single Parameter......Page 170
Writing Procedures that Require Multiple Parameters......Page 171
Exercise 9-3: Writing Procedures that Require Multiple Parameters......Page 173
LAB 9.3 Writing Procedures that Require Multiple Parameters......Page 174
Writing Functions that Return a Value......Page 175
Exercise 9-4: Writing Functions that Return a Value......Page 177
LAB 9.4 Writing Functions that Return a Value......Page 178
Passing an Array and an Array Element to a Procedure or Function......Page 179
Exercise 9-5: Passing Arrays to Procedures and Functions......Page 182
LAB 9.5 Passing Arrays to Procedures and Functions......Page 183
Using Visual Basic’s Built-In Functions......Page 184
LAB 9.6 Using Visual Basic’s Built-In Functions......Page 186
CHAPTER 10: Creating a Graphical User Interface (GUI) Using the Visual Studio Integrated Development Environment (IDE)......Page 188
The Visual Studio Integrated Development Environment......Page 189
The Solution Folder......Page 191
The Designer Window......Page 192
The Code Window......Page 193
Design-Time and Run-Time Operating Modes......Page 194
Creating a Visual Basic IDE Program......Page 195
Designing the Form for the Doubler Program......Page 196
Exercise 10-1: Elements of a GUI in Microsoft Visual Studio......Page 200
A Programmer-Defined Class......Page 201
Creating a Programmer-Defined Class......Page 202
Adding Properties to a Class......Page 204
Adding Methods to a Class......Page 205
Exercise 10-2: Creating a Class in Visual Basic......Page 208
LAB 10.2 Creating a Class in Visual Basic......Page 209
Index......Page 212