An Overview of Visual Basic



Overview

An Overview of Visual Basic .NET

[pic]

Instructor’s Notes

Overview

Outline

Objectives

Lecture Notes

Key Terms

[pic]

Overview

You will get a brief history of programming languages. It will also include a Visual Basic .NET demonstration program. This tutorial will give you an overview of how to use the tutorials effectively.

Outline

|Lecture Topics |Pages # |Teaching Suggestions in this Manual |

|A Brief History of Programming Languages |1-5 |A Brief History of Programming Languages through |

| | |Object-Oriented/Event-Driven High-Level Languages |

|An Introduction to the Terminology Used in Object-Oriented |5-7 |OOP Terminology |

|Programming Languages | | |

|A Visual Basic .NET Demonstration |7-9 |A Visual Basic .NET Demonstration |

|Information on Using the Tutorials Effectively |9-10 |Using the Tutorials Effectively |

Overview Objectives:

This overview contains basic definitions and background information, including:

• A brief history of programming languages

• An introduction to the terminology used in object-oriented programming languages

• A Visual Basic .NET demonstration

• Information on using the tutorials effectively

Lecture Notes

A Brief History of Programming Languages

Computers still rely on human beings to give them directions. These directions are called programs, and the people who write the programs are called programmers. Just as human beings communicate with each other through the use of languages such as English, Spanish, Hindi, and Chinese, programmers use a variety of special languages, called programming languages, to communicate with the computer.

Machine Languages

Within a computer, microscopic electronic switches that can be either off or on represent all data. A 0 designates the off switch, and a 1 designates the on switch. Instructions written in 0s and 1s are called machine language or machine code. The machine language (each type of machine has its own language) represents the only way to communicate directly with the computer.

Assembly Languages

Slightly more advanced programming languages are called assembly languages. The assembly languages simplify the programmer’s job by allowing the programmer to use mnemonics in place of the 0s and 1s in the program. Mnemonics are memory aids(in this case, alphabetic abbreviations for instructions. The mnemonic MOV is used to move data from one area of the computer’s memory to another. Programs written in an assembly language require an assembler, which also is a program, to convert the assembly instructions into machine code(the 0s and 1s the computer can understand.

High-Level Languages

High-level languages, which allow the programmer to use instructions that more closely resemble the English language, represent the next major development in programming languages. Programs written in a high-level language require either an interpreter or a compiler to convert the English-like instructions into the 0s and 1s the computer can understand. Like assemblers, both interpreters and compilers are separate programs. An interpreter translates the high-level instructions into machine code, line by line, as the program is running, whereas a compiler translates the entire program into machine code before running the program.

Procedure-Oriented High-Level Languages

In procedure-oriented high-level languages, the emphasis of a program is on how to accomplish a task. The programmer must instruct the computer every step of the way, from the start of the task to its completion. The programmer determines and controls the order in which the computer processes the instructions. Examples of procedure-oriented high-level languages include COBOL, BASIC (Beginner’s All-Purpose Symbolic Instruction Code), and C.

Procedure-oriented high-level languages are a vast improvement over machine and assembly languages. Some of the procedure-oriented high-level languages(for example, the BASIC language(do not require a great amount of technical expertise to write simple programs.

The Introduction of Windows

Windows software provides an easy-to-use graphical user interface, referred to as a GUI, with which a user can interact. This GUI is common to all applications written for the Windows environment. Although the standard interface found in all Windows applications makes the user’s life much easier, it complicates the programmer’s life a great deal.

Tasks that used to take a few lines of program code now needed pages. Because programming, Windows applications required a great amount of expertise, it appeared that the beginning of the Windows environment meant the end of the do-it-yourself, nonprofessional programmer.

Object-Oriented/Event-Driven High-Level Languages

The object-oriented/event-driven high-level languages simplified the task of programming applications for Windows. In object-oriented/event-driven high-level languages, the emphasis of a program is on objects included in the user interface (such as scroll bars and buttons) and the events (such as scrolling and clicking) that occur when those objects are used.

The object-oriented method allows the programmer to use familiar objects to solve problems. The ability to use objects that model things found in the real world makes problem solving much easier.

Visual Basic .NET is an object-oriented/event-driven programming language that is easy enough for a nonprogrammer to use, yet sophisticated enough to be used by professional programmers. With Visual Basic it takes just a few clicks of the mouse to include standard Windows objects such as buttons, list boxes, scroll bars, and icons in your Windows application.

OOP Terminology

OOP is an acronym for object-oriented programming and simply means that you are using an object-oriented language to create a program that contains one or more objects. OOD, on the other hand, is an acronym for object-oriented design. Like top-down design, which is used to plan procedure-oriented programs, OOD also is a design methodology, but is used to plan object-oriented programs. Unlike top-down design, which breaks up a problem into one or more tasks, OOD divides a problem into one or more objects.

An object is anything that can be seen, touched, or used; in other words, an object is nearly any thing. An object can also represent something encountered in real life. Every object has attributes and behaviors. The attributes are the characteristics that describe the object. An object’s behaviors, on the other hand, are the operations (actions) that the object is capable of performing.

A class is a pattern or blueprint used to create an object. Every object used in an object-oriented program comes from a class. A class contains(or, in OOP terms, it encapsulates(all of the attributes and behaviors that describe the object the class creates. Abstraction refers to the hiding of the internal details of an object from the user; hiding the internal details helps prevent the user from making inadvertent changes to the object. Attributes and behaviors that are not hidden are said to be exposed to the user.

Another OOP term, inheritance, refers to the fact that you can create one class from another class. The new class, called the derived class, inherits the attributes and behaviors of the original class, called the base class. Polymorphism is the object-oriented feature that allows the same instruction to be carried out differently depending on the object.

A Visual Basic .NET Demonstration

The Visual Basic .NET application you are about to run shows you only some of the objects you learn how to create in the tutorials. For now, it is not important for you to understand how these objects were created or why the objects perform the way they do.

Using the Tutorials Effectively

The tutorials in this book will help you learn about Microsoft Visual Basic .NET, the newest version of the Visual Basic programming language. The tutorials are designed to be used at your computer. Begin by reading the text that explains the concepts. Then when you come to the numbered steps, follow the steps on your computer. Read each step carefully and completely before you try it.

As you work, compare your screen with the figures to verify your results. Each tutorial is divided into three lessons. You might want to take a break between lessons. Following each lesson is a Summary section that lists the important elements of the lesson.

At the end of Lesson C in each tutorial you will find one or more Debugging exercises. In programming, the term debugging refers to the process of finding and fixing any errors in a program. Debugging exercises provide debugging tips and allow you to practice debugging applications. Throughout the book you will find GUI (Graphical User Interface) boxes. These boxes contain guidelines and recommendations so that your applications follow the Windows standard.

Quick Quiz

1. __________ are directions, and the people who write the programs are called ___________. ANSWER: program and programmers

2. Instructions written in 0s and 1s are called __________. ANSWER: machine language or machine code

3. A(n) __________ translates the high-level instructions into machine code, line by line, as the program is running. ANSWER: interpreter

4. __________ refers to the hiding of the internal details of an object from the user. ANSWER: Abstraction

Key Terms

Abstraction – refers to the hiding of the internal details of an object from the user.

Assembly language – More advanced programming languages allowing the programmer to use mnemonics in place of 0s and 1s in the program.

Attributes – are the characteristics that describe the object.

Base class – the original class that the attributes and behaviors are gotten from.

Behaviors – are the operations that the object is capable of performing.

Class – is a pattern or blueprint used to create an object.

Derived class – the new class that inherits the attributes and behaviors of the original class.

Compiler – translates the entire program into machine code before running the program.

Debugging – refers to the process of finding and fixing any errors in a program.

Graphical user interface (GUI) – is used to interact with Windows applications.

High-level languages – allow the programmer to use instructions that more closely resemble the English language, represent the next major development in programming languages.

Inheritance – refers to the fact that you can create one class from another class.

Interpreter – translates the high-level instructions into machine code, line by line, as the program is running.

Machine code/machine language – Instructions written in 0s and 1s.

Mnemonics – are memory aids

Object – is anything that can be seen, touched, or used.

Object-oriented/event-driven languages – the emphasis of a program is on the objects included in the user interface and the events that occur when those objects are used.

OOD – is an acronym for object-oriented design and is a design methodology, but it is used to plan object-oriented programs.

OOP – is an acronym for object-oriented programming and simply means that you are using an object-oriented language to create a program that contains one or more objects.

Polymorphism – is the object-oriented feature that allows the same instruction to be carried out differently depending on the object.

Procedure-oriented high-level languages – the emphasis of a program is on how to accomplish a task.

Program – directions given to a computer

Programmer – Person who writes the programs

Programming languages – a variety of special languages used to communicate with the computer.

Solutions to Exercises can be found within the Instructor’s Resource Kit (CD-ROM) that accompanies this text or at the following link:



................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download