图书简介:
Contents
Chapter 1 Visual Basic, Controls, and Events 1
1.1 An Introduction to Visual Basic 2015 1
1.2 Visual Basic Controls 3
1.3 Visual Basic Events 21
Chapter 2 Variables, Input, and Output 36
2.1 Numbers 36
2.2 Strings 54
2.3 Input and Output 74
Chapter 3 Decisions 93
3.1 Relational and Logical Operators 93
3.2 If Blocks 101
3.3 Select Case Blocks 122
3.4 Input via User Selection 136
Chapter 4 General Procedures 154
4.1 Function Procedures 154
4.2 Sub Procedures, Part I 170
4.3 Sub Procedures, Part II 185
4.4 Program Design 196
4.5 A Case Study: Weekly Payroll 199
Chapter 5 Repetition 212
5.1 Do Loops 212
5.2 For . . . Next Loops 226
5.3 List Boxes and Loops 240
Chapter 6 Arrays 256
6.1 Creating and Using Arrays 256
6.2 Using LINQ with Arrays 282
6.3 Arrays of Structures 296
6.4 Two-Dimensional Arrays 322
6.5 A Case Study: Analyze a Loan 335
Chapter 7 Additional Controls and Objects 352
7.1 List Boxes and Combo Boxes 352
7.2 Eight Additional Controls and Objects 360
7.3 Multiple-Form Programs 375
7.4 Graphics 387
Chapter 8 Object-Oriented Programming 406
8.1 Classes and Objects 406
8.2 Working with Objects 423
8.3 Inheritance 434
Chapter 9 Databases 454
9.1 An Introduction to Databases 454
9.2 Editing and Designing Databases 478
Chapter 10 Text Files 488
10.1 Managing Text Files 488
10.2 StreamReaders, StreamWriters, and Structured Exception Handling 504
10.3 A Case Study: Recording Checks and Deposits 522
Appendices…………………………………………………………………………………………………535
Appendix A ANSI Values 535
Appendix B How To 537
Appendix C Files and Folders 549
Appendix D Visual Basic Debugging Tools 550
展开
Preface
Visual Basic has been a widely used programming language since its introduction in 1991. Its latest incarnation, Visual Basic 2015, brings continued refinement of the language. Visual Basic programmers are enthusiastically embracing the powerful capabilities of the language. Likewise, students learning their first programming language will find VB the ideal tool to understand the development of computer programs.
My objectives when writing this text were as follows:
1. To develop focused chapters. Rather than covering many topics superficially, I concentrate on important subjects and cover them thoroughly.
2. To use examples and exercises with which students can relate, appreciate, and feel comfortable. I frequently use real data. Examples do not have so many embellishments that students are distracted from the programming techniques illustrated.
3. To produce compactly written text that students will find both readable and informative. The main points of each topic are discussed first and then the peripheral details are presented as comments.
4. To teach good programming practices that are in step with modern programming methodology. Problem solving techniques and structured programming are discussed early and used throughout the book.The style follows object-oriented programming principles.
5. To provide insights into the major applications of computers. What’s New in the Tenth Edition Among the changes in this edition, the following are the most significant.
1. Visual Basic Upgraded The version of Visual Basic has been upgraded from Visual Basic 2012 to Visual Basic 2015, and relevant new features of Visual Basic 2015 have been addressed.
2. Additional Exercises Sixty new exercises have been added, most of which are application exercises.
3. Updated Data The real-world data appearing in exercises, examples, and data files has been updated.
4. Decimal Data Type The Decimal data type has been introduced and used in all examples and exercises dealing with financial data.
5. Short-Circuit Evaluation AndAlso and OrElse are introduced for the evaluation of logical operators.
6. Windows 10 The screen captures have been updated from Windows 8 to Windows 10 captures.
7. New Statements and Methods The Exit Sub and Exit Function statements and the string methods Remove and Replace are discussed.
Unique and Distinguishing Features
Exercises for Most Sections. Each section that teaches programming has an exercise set. The exercises both reinforce the understanding of the key ideas of the section and challenge the student to explore applications. Most of the exercise sets require the student to trace programs, find errors, and write programs. The answers to all the odd-numbered exercises in Chapters 2 through 7 and the short-answer odd-numbered exercises from Chapters 8, 9, 10, and 11 are given at the end of the text. A screen capture accompanies most programming answers.
Practice Problems. Practice Problems are carefully selected exercises located at the end of a section, just before the exercise set. Complete solutions are given following the exercise set. The practice problems often focus on points that are potentially confusing or are best appreciated after the student has thought about them. The reader should seriously attempt the practice problems and study their solutions before moving on
to the exercises.
Programming Projects. Beginning with Chapter 3, every chapter contains programming projects. The programming projects not only reflect the variety of ways that computers are used in the business community, but also present some games and general-interest topics. The large number and range of difficulty of the programming projects provide the flexibility to adapt the course to the interests and abilities of the students. Some programming projects in later chapters can be assigned as end-of-thesemester projects.
Comments. Extensions and fine points of new topics are deferred to the “Comments” portion at the end of each section so that they will not interfere with the flow of the presentation.
Captions. Every example and applied exercise is labeled with a caption identifying its type of application.
Screen Captures. The output for most applied exercises and programming projects are shown in screen captures. This feature helps clarify the intent of the exercises.
Case Studies. Each of the three case studies focuses on an important programming application. The problems are analyzed and the programs are developed with topdown charts and pseudocode. The programs can be downloaded from the companion website at http://www.pearsonhighered.com/schneider.
Chapter Summaries. In Chapters 2 through 11, the key results are stated and the important terms are summarized at the end of the chapter.
“How To” Appendix. Appendix B provides a compact, step-by-step reference on how to carry out standard tasks in the Visual Basic and Windows environments.
Appendix on Debugging. The placing of the discussion of Visual Basic’s sophisticated debugger in Appendix D allows the instructor flexibility in deciding when to cover this topic.
Solution Manuals. The Student Solutions Manual contains the answer to every oddnumbered exercise. The Instructor Solutions Manual contains the answer to every exercise and programming project. Both solution manuals are in pdf format and can be downloaded from the Publisher’s Web site.
Source Code. The programs for all examples and case studies can be downloaded from the Publisher’s Web site.
How to Access Instructor and Student Resource Materials
Online Practice and Assessment with MyProgrammingLab helps students fully grasp the logic, semantics, and syntax of programming. Through practice exercises and immediate, personalized feedback, MyProgrammingLab improves the programming competence of beginning students who often struggle with the basic concepts and paradigms of popular high-level programming languages.
A self-study and homework tool, the MyProgrammingLab course for Visual Basic consists of roughly two hundred small practice exercises covering introductory topics such as variables, calculations, decision statements, loops, procedures, arrays, and more. For students, the system automatically detects errors in the logic and syntax of their code submissions and offers targeted hints that enable students to figure out what went wrong—and why. For instructors, a comprehensive gradebook tracks correct and incorrect answers and stores the code inputted by students for review.
For a full demonstration, to see feedback from instructors and students, or to get started using MyProgrammingLab in your course, visit www.myprogramminglab.com.
Instructor Resources
The following protected instructor resource materials are available on the Publisher’s Web site at www.pearsonhighered.com/cs-resources. For username and password information, please contact your local Pearson representative.
Test Item File
PowerPoint Lecture Slides
Instructor Solutions Manual
VideoNotes
Programs for all examples, case studies, and answers to exercises and programming projects (Databases, text files, and picture files needed for the exercises are included in the Programs folder.)
Student Resources
Access to the Premium Website and VideoNotes tutorials is located at www.pearsonhighered. com/cs-resources. Students must use the access card located in the front of the book to register and access the online material. If there is no access card in the front of this textbook, students can purchase access by going to www.pearsonhighered. com/cs-resources and selecting “purchase access to premium content.” Instructors must register on the site to access the material.
The following content is available through the Premium Web site:
Student Solutions Manual
Programs for examples and case studies (Databases, text files, and picture files needed for the exercises are included in the Programs folder.)
展开