Cambridge Catalogue  
  • Help
Home > Catalogue > Programming in Visual Basic 2010
Programming in Visual Basic 2010

Resources and solutions

This title has free online support material available.

Details

  • 234 b/w illus. 36 tables 376 exercises
  • Page extent: 784 pages
  • Size: 253 x 215 mm
  • Weight: 1.22 kg

Paperback

 (ISBN-13: 9780521721110)

Programming in Visual Basic 2010
Cambridge University Press
9780521896535 - Programming in Visual Basic 2010 - The Very Beginner's Guide - By Jim McKeown
Frontmatter/Prelims

Programming in Visual Basic 2010

This book is an introduction to programming using Microsoft's Visual Basic .NET 2010. It is intended for novice programmers with little or no programming experience or no experience with Visual Basic. The text emphasizes programming logic and good programming techniques with generous explanations of programming concepts written from a nontechnical point of view. It stresses input, processing, and output and sequence, selection, and repetition in code development. File input and output (I/O) and arrays are included. Later chapters introduce objects, event programming, and databases. By taking a slow and steady approach to programming ideas, this book builds new concepts from what the reader has already learned. VB tips and quips inject both humor and insight.

The book includes numerous programming examples and exercises, case studies, tutorials, and “Fixing a Program” sections for an in-depth look at programming problems and tools. Quizzes and review questions throughout each chapter get students to think about the materials and how to use them. Each chapter has a summary and glossary for extra review.

The accompanying web site has code downloads, I/O, and database files from small, simple files to large files with thousands of records, flowcharts, deskchecks, and audits to aid with program design, coding, and debugging, PowerPoint files for every chapter, and hundreds of ideas for programs and projects.

Dr. Jim McKeown has spent more than 20 years at Dakota State University, where he is an Assistant Professor. He currently teaches programming, computer hardware, software testing, and computer applications. He received a master's degree in computer education from Columbia University and holds a Ph.D. in instructional design from the University of Iowa. He has contributed several articles to the Journal for Computing in Small Colleges as well as various other publications.


Programming in Visual Basic 2010

The Very Beginner's Guide

Jim McKeown

Dakota State University


CAMBRIDGE UNIVERSITY PRESS
Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo, Delhi, Dubai, Tokyo

Cambridge University Press
32 Avenue of the Americas, New York, NY 10013-2473, USA

www.cambridge.org
Information on this title: www.cambridge.org/9780521721110

© Jim McKeown 2010

This publication is in copyright. Subject to statutory exception and to the provisions of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press.

First published 2010

Printed in the United States of America

A catalog record for this publication is available from the British Library.

Library of Congress Cataloging in Publication dataMcKeown, James S.Programming in Visual Basic 2010 : the very beginner's guide / James S. McKeown.p. cm.Includes bibliographical references and index.ISBN 978-0-521-89653-5 – ISBN 978-0-521-72111-0 (pbk.)1. Microsoft Visual BASIC. 2. BASIC (Computer program language) 3. Microsoft .NET. I. Title.QA76.73.B3M39723 2010006.7′882–dc22 2010000054

ISBN 978-0-521-89653-5 Hardback
ISBN 978-0-521-72111-0 Paperback

Additional resources for this publication at http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=9780521721110

Cambridge University Press has no responsibility for the persistence or accuracy of URLs for external or third-party Internet Web sites referred to in this publication and does not guarantee that any content on such Web sites is, or will remain, accurate or appropriate.


Quick, who won the Academy Award for Best Screenplay last year? Who won a Grammy last year? Who pitched the last game of the World Series? How often do the rich and famous make headlines for their good work, not their misdeeds? These people don't impact your life so why is society obsessed them? And you certainly don't want to emulate many of them. Look around and find the ones that do impact your life and pay attention to them.

Thank you to the reviewers. Without their hard and sometimes thankless work, this book wouldn't be nearly as good. I especially want to thank Rudy McDaniel for his keen eye and suggestions.

Thank you to Mrs. Heneghen, my first grade teacher, who taught me how to read and write and do arithmetic. She was a wonderful lady. Thank you to Mrs. Short. She instilled in me a love of learning I carry to this day. She's still my neighbor and I've never been able to turn her down when she's asked for a favor. Mrs. Pratt taught me multiplication and division, Mrs. Moulton taught me science, and Mrs. Stuefen first taught me geography. I still love doing math in my head, studying science, and poring over maps. Miss Haggerty – there wasn't a boy in the sixth grade that wasn't in love with her. I admired and respected Mr. Skovlund. Mr. Tordoff taught me typing. I still use it every day, but he taught his best lessons with a whistle in his hand. Mrs. Hefling was my English and speech teacher. I can make my living through writing and speaking because of her. Mr. Magnus taught me algebra and physics and always had time to answer questions. He was a good man. Mr. Vincent was my history teacher and coach. His quiet dignity touched students for nearly forty years. He made me a better person. Dr. Jerry Sweeney was my college advisor. He saw something in this skinny farm boy. Thank you to Anne Vollmer, Nancy Cunniff, and Howard Budin in grad school. Thank you to Dr. Jim Maxey. He was a vice president at ACT but still had time to help me with my dissertation. These teachers made a difference in my life and I'll never forget that.

To Delores. See? Being a computer geek finally paid off. Now, I can start working on the movie.

Jim McKeown

April 3, 2009


Contents

1             Fundamentals of Design and Programming – Starting from Scratch
1
2             Variables and Constants – A Place for Everything and Everything in Its Place
36
3             Writing Programs – First You Walk, Then You Run
68
4             Writing Programs II – More Controls and New Logic
105
5             Using If and Case – Decisions, Decisions, Decisions
144
6             Loops – Once Is Not Enough
184
7             Procedures and Functions – Divide and Conquer
224
8             Writing Programs III – Tying It All Together, So Far
258
9             File I/O – Files and Records and Fields, Oh My!
315
10            Arrays and Structures – Organizing Data
367
11            Events and More Controls – Tips and Tricks for Programming
429
12            Objects and Classes – Objects Are in a Class By Themselves
475
13            Graphics – The Visual (and Audio) Side of Visual Basic
515
14            LINQ to SQL – The World Runs on Databases
571
15            Crystal Reports – Tying Databases to Output
601
Appendices
631

Contents

Preface
xv
1             Fundamentals of Design and Programming – Starting from Scratch
1
What Is Programming?
1
Basic Tasks
2
Basic Procedures
3
Following Directions
5
Interface/Instructions – The Human/Computer Connections
7
What Is a Program?
9
Your First Program – College Tuition
10
VB Basics
12
Summary
28
Review
28
Terms
29
Keywords
31
2             Variables and Constants – A Place for Everything and Everything in Its Place
36
Computer Memory: Location, Location, Location
36
Declarations, Input, Processing, Output – No Program Should Be Without Them
47
Summary
61
Review
61
Terms
62
Keywords
63
3             Writing Programs – First You Walk, Then You Run
68
Following IPO
68
Commenting Your Code
71
Formatting Your Output
71
Errors in Your Program
72
Debugging Practice
74
Controlling Your Controls
78
Data Type Conversion
83
Jim Soxx Sports Sales Program
85
Open and Run
93
Fixing a Program – Van Nilla's Ice Cream Stand
97
On Your Own
98
Summary
99
Review
99
Terms
100
Keywords
100
4             Writing Programs II – More Controls and New Logic
105
Variable Scope
105
Counters and Accumulators
107
More Data Types
109
Methods
112
The Load Event
115
More Controls
116
Controlling Strings
123
Tying It All Together
125
Fixing a Program
131
On Your Own
136
Summary
136
Review
136
Terms
137
Keywords
138
5             Using If and Case – Decisions, Decisions, Decisions
144
What Are Decision Structures?
144
If…Then…Else Structures
144
Flowchart Update
145
Deskcheck
155
Potential Problems
156
Data Validation
156
Stacked If Structures
161
ElseIf
161
Guessing Game Case Study
163
Case Structures
168
A Roll of the Dice Case Study
171
Tying It All Together
175
On Your Own
177
Summary
177
Review
177
Terms
178
Keywords
179
6             Loops – Once Is Not Enough
184
What Are Loops?
184
For…Next Loops
185
Do While Loops
188
Do Loop While
189
Do Until Loops
192
Do Loop Until
194
Loop Questions
196
Infinite Loops
199
Nested Loops
200
Chr and Asc Commands
202
A Little Fun With Graphics
204
Tying It All Together
208
Potential Problems
214
Fixing a Program
215
On Your Own
216
Summary
216
Review
217
Terms
217
Keywords
218
7             Procedures and Functions – Divide and Conquer
224
Why Use Procedures?
224
Flowcharting Procedures
232
Potential Problems
232
Functions
233
Flowcharting Functions
239
Potential Problems
240
New Controls – Menus and Timers
241
Tying It All Together
245
Fixing a Program
251
On Your Own
252
Summary
253
Review
253
Terms
254
Keywords
254
8             Writing Programs III – Tying It All Together, So Far
258
RadioButtons
258
CheckBoxes
263
Potential Problems
268
ListBoxes
268
ComboBoxes
275
CheckedListBoxes
279
Tab Controls, ScrollBars, and TrackBars
281
Multiple Forms
284
Controlling Strings
286
MaskedTextBox
291
Pizza Program Finished
292
Tying It All Together
295
Potential Problems
304
On Your Own
304
Summary
305
Review
305
Terms
307
Keywords
308
9             File I/O – Files and Records and Fields, Oh My!
315
The Basics of File Input and Output
315
Sequential File Access
317
File Output
323
Dialog Boxes
326
Try-Catch Blocks
331
Intro to Namespaces
332
Control Break Programming
334
Minor Control Break Processing
340
Updating Files
347
Merging Files
350
Fixing a Program
353
On Your Own
356
Summary
357
Review
357
Terms
358
Keywords
360
10            Arrays and Structures – Organizing Data
367
Arrays – Order by the Numbers
367
Using an Array
370
Arrays and Loops – Hand in Hand
374
Loading an Array From a File
375
Searching an Array
389
Sorting an Array
395
Two-Dimensional Arrays
406
Student Grade Program Case Study
411
Structures
415
On Your Own
422
Summary
422
Review
422
Terms
423
Keywords
424
11            Events and More Controls – Tips and Tricks for Programming
429
New Events
429
Mouse Events
436
Potential Problems
438
Potential Problems
443
New Controls
443
Variable Scope
451
Globals
453
Overloading
454
Event Handlers
457
Potential Problems
461
Fixing a Program
462
On Your Own
464
Summary
464
Review
465
Terms
466
Keywords
467
12            Objects and Classes – Objects Are in a Class By Themselves
475
Built-in Objects
475
Creating Classes of Your Own
477
Using Classes
480
Student Grade Class
483
Potential Problems
486
Employee Pay Class
488
Inheritance
497
Potential Problems
504
Why Use Classes?
505
Fixing a Program
505
On Your Own
509
Summary
509
Review
509
Terms
510
Keywords
510
13            Graphics – The Visual (and Audio) Side of Visual Basic
515
Graphic Basics
515
Drawing
519
Images
526
Potential Problems
527
Simple Paint Tutorial
528
Sound
541
Windows Media Player
544
Creating Charts
546
Potential Problems
561
Fixing a Program
561
On Your Own
564
Summary
564
Review
565
Terms
566
Keywords
566
14            LINQ to SQL – The World Runs on Databases
571
Background
571
Connecting to a Database Tutorial
572
Wages Tutorial
581
Potential Problems
586
Customer Queries
587
Potential Problems
592
On Your Own
593
Summary
594
Review
594
Terms
595
Keywords
597
15            Crystal Reports – Tying Databases to Output
601
Crystal Reports Tutorial
601
Creating a Report Using the Report Wizard
611
Mailing Labels
619
Potential Problems
623
On Your Own
624
Summary
624
Review
625
Terms
626
Keywords
626
Appendix A    American Standard Code for Information Interchange (ASCII) Table
631
Appendix B    Flowchart Table
638
Appendix C    My Application
641
Appendix D    Customizing Your VB Environment
643
Appendix E    Using Help
646
Appendix F    Using Debug
650
Appendix G    Structured Query Language (SQL) Basics
657
Appendix H    Answers to Self-Check Questions
661
Appendix I    Control and Variable Naming Conventions
679
Index
681



© Cambridge University Press
printer iconPrinter friendly version AddThis