Visual Basic.Net for Students

Preface

This book is for novices

If you have never done any programming before - if you are a complete novice - this book is for you. This book assumes no prior knowledge of programming. It starts from scratch. It is written in a simple, direct style for maximum clarity. It is aimed at first level students at universities and colleges, but it is also suitable for novices studying alone.

Why Visual Basic?

Visual Basic is arguably one of the best programming languages to learn and use in the 21st century, because:

You will need

To learn to program you need a PC running Windows and the software that allows you to prepare and run Visual Basic.Net programs in a convenient way. There are two versions of the software - Visual Basic .Net (for Visual Basic alone) and Visual Studio .Net (a more fulsome package).

How is Visual Basic.Net different from earlier versions of Visual Basic?

Visual Basic.Net is a fully-fledged Object Oriented language, supporting encapsulation, single inheritance and polymorphism. In creating Visual Basic.Net, Microsoft has made Visual Basic into an elegant and consistent language. This makes the language easier to learn, easier to use and programs more robust. In addition it encourages the use of good programming style.

Visual Basic.Net is the successor to Visual Basic 6, but there are marked changes and limited compatibility. A Visual Basic 6 program will not run unchanged under Visual Basic.Net.

Visual Basic.Net is part of a suite of tools associated with the .Net architecture, but it is also an independent programming language. It can be used either to write free-standing program or to create components that fit within the .Net architecture.

The approach of this book

We explain how to use objects early in this book. Our approach is to start with the ideas of variables, assignment and methods, then introduce using objects created from library classes. Next we explain how to use control structures for selection and looping. Then comes the treatment of how to write your own classes.

We wanted to make sure that the fun element of programming was paramount, so we use graphics right from the start. We think graphics is fun, interesting and clearly demonstrates all the important principles of programming. But we haven't ignored programs that input and output text - they are also included.

The programs we present use many of the features of a graphical user interfaces (GUIs), such as buttons, scroll bars and text boxes. But we also explain how to write console programs in Visual Basic.Net.

We introduce new ideas carefully one-at-a-time, rather than all at once. So, for example, there is a single chapter on writing methods. We introduce simple ideas early and more sophisticated ideas later on.

What's included?

This book explains the fundamental ideas of programming:

It explains how to use numbers and character strings. Arrays are also described. These are all topics that are fundamental, whatever kind of programming you do. This book also thoroughly explains the object-oriented aspects of programming - using objects, writing classes, methods and properties, and using library classes. We also look at some of the more sophisticated aspects of object-oriented programming including inheritance, polymorphism and interfaces.

 What's not included

This book confines itself to the essentials of Visual Basic.Net. It does not explain all the bits and pieces, the bells and whistles. Thus the reader is freed from unnecessary detail and can concentrate on mastering Visual Basic and programming in general.

 UML

The Unified Modeling Language (UML) is the current mainstream notation for describing programs. We use elements of UML selectively, where appropriate, throughout this book

Applications

Computers are used in many different applications and this book uses examples from all areas including:

We have also included a few exercises which look at the exciting idea of artificial life.

The reader can choose to concentrate on those application areas of interest and ignore other areas.

Exercises are good for you

If you were to read this book time and again until you could recite it backwards, you still wouldn't be able to write programs. The practical work of writing programs is vital to becoming fluent and confident at programming.

There are exercises for the reader at the end of each chapter. Please do some of them to enhance your ability to program.

There are also short self-test questions throughout the text, so that you can check you have understood things properly. The answers are given at the end of each chapter.

Have fun

Programming is creative and interesting, particularly in Visual Basic. Please have fun!

Visit our Web site

The web site includes:

Our Web site can be reached via the Pearson Education web site at:

www.booksites.net