Visual Basic Programming Handouts-Part1
Visual Basic Programming Handouts-Part1
Cristy Tungpalan
SY 2016-2017
INTRODUCTION TO PROGRAMMING
PROGRAMMING CONCEPTS
A program is an organized list of instructions that, when executed, causes the computer to
behave in a predetermined manner. Without programs, computers are useless.
A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions
(called statements) that tell the computer what to do with the variables. The variables can
represent numeric data, text, or graphical images.
The terms computer program, software program, or just program are used to refer to either an
executable program or the collection of source code from which it is created or compiled using a
programming language.
Programming is the iterative process of writing or editing source code. Editing source code
involves testing, analyzing, and refining. A person who practices this skill is referred to as a
computer programmer or software developer. The sometimes lengthy process of computer
programming is usually referred to a software development.
Programmers translate the solutions or tasks into a language the computer can understand. As
we write programs, we must keep in mind that the computer will only do what we instruct it to
do. Because of this, we must be very careful and thorough with our instructions.
A programming language acts as a translator between you and the computer. Rather than
learning the computer's native language (known as machine language), you can use a
programming language to instruct the computer in a way that is easier to learn and understand.
Human Language
Compiler / Translator /
Interpreter
(Programming Language)
Machine
Language
After you write a program, your source language (written in a programming language) are
compiled into a machine code that is stored as an executable file (usually .EXE file)
A programming language is a set of rules that provides a way of telling a computer what
operations to perform. A specialized program known as a compiler takes the instructions written
in the programming language and converts them to machine language. This means that as a
programmer, you don't have to understand what the computer is doing or how it does it. You just
have to understand how the programming language works.
TYPES OF PROGRAMMING LANGUAGES
and PROGRAMMING LANGUAGE GENERATIONS
1. LOW–LEVEL LANGUAGES
Low-level languages have the advantage that they can be written to take advantage of any
peculiarities in the architecture of the central processing unit (CPU). Thus, a program written
in a low-level language can be extremely efficient, making optimum use of both computer
memory and processing time. However, to write a low-level program takes a substantial
amount of time, as well as a clear understanding of the inner workings of the processor itself.
Therefore, low-level programming is typically used only for very small programs, or for
segments of code that are highly critical and must run as efficiently as possible.
Assembly Language (ASL) uses structures commands as substitutions for numbers allowing
humans to read the code easier than looking at binary. Although easier to read than binary,
assembly language is a difficult language and is usually substituted for a higher language such as C.
2. HIGH-LEVEL LANGUAGES
High-level programming languages allow the specification of a problem solution in terms
closer to those used by human beings. These languages were designed to make programming
far easier, less error-prone and to remove the programmer from having to know the details of
the internal structure of a particular computer. This language is used in third generation.
Other third generation languages include C, C++, Java/JavaScript, Visual Basic and among
others.
Fourth Generation Languages or 4GL (Very High-Level Languages)
Fourth generation programming languages are more aimed at problem solving. The key difference
is that they are more concerned with what is to be done than the actual how. These are generally
to do with accessing databases. They are probably the easiest of the four generations to read as
they have been deliberately designed to reflect normal language and are often tolerant of errors.
Examples include Prolog, SQL, MySQL, RPG III, VB.net etc. because they are so far removed from
first generation languages they tend to be very platform independent and willing to run on many
different families of processor
Fifth Generation Languages or 5GL
5GL or fifth-generation
language is programming
language that uses a visual or
graphical development interface
to create source language that is
usually compiled with a 3GL or 4GL
language compiler. Microsoft,
Borland, IBM, and other
companies make 5GL visual
programming products for
developing applications in Java, for
example Visual programming
allows you to easily envision
object-oriented programming class
hierarchies and drag icons to
assemble program components.
Determining which language to use is one of the first decisions that you need to make for any
programming project. The natural inclination is to use a language that you already know, but in
some cases this choice can end up being the wrong one. As with any task, it is important to use
the right tool for the job.
Choosing the best language for a task may sound like a complex process, but the choice are not
really that overwhelming. Most programmers will do well with one of the popular general-
purpose languages, avoiding those that are either obsolete or designed for specialized use.
BASIC remains the most popular language in use today for the following situations: general-
purpose programming, developing small-to intermediate-sized applications where performance is
not critical, or if you are learning how to program.
LANGUAGE OF COMPUTING
Computers communicate through the use of electronic pulses (1’s and 0’s). Data that is fed into
the computer turn into electronic pulses which can only be either the presence of current (on), or
its absence (off). The ‘off’ condition corresponds to the value ‘0’ and the ‘on’ condition
corresponds to the value ‘1’.
In short, a computer as an electronic device translates input data into a format or language that
the computer can understand. In turn, the computer processes and transforms data into an
output that we, humans can understand. The language that a computer can understand is called
machine language.
UNITS OF DATA
Bit, Byte, Character
Machine language is the computer’s language. It is the only language a computer is capable of
understanding. More specifically, it is a group of zeroes and ones that t. he computer reads and
interprets.
The very basis of machine language is the binary number system. Each ‘0’ or ‘1’ is called a binary
digit or bit, for short. A bit can hold only one of two values: 0 or 1, corresponding to the electrical
values of off or on, respectively. Bits are typically collected into a group of eight to form a byte.
Whereas a byte contains enough information to store only a single character, a character is the
smallest unit of information for humans.
21 =2 26= 2*2*2*2*2*2 = 64
2
2 = 2*2 =4 27= 2*2*2*2*2*2*2 = 128
3
2 = 2*2*2 =8 28= 2*2*2*2*2*2*2*2 = 256
4
2 = 2*2*2*2 = 16 29= 2*2*2*2*2*2*2*2 = 512
25= 2*2*2*2*2 = 32 210= 2*2*2*2*2*2*2*2 = 1,024
So, the following units are used:
The purpose of standardizing a binary code for every character is to give the computer user the
capability of using several machines to process data regardless of the manufacturer. ASCII is
commonly used in the transmission of data through data communications and is used almost
exclusively to represent data internally in microcomputers. Below is the ASCII code table:
ASCII
ASCII is an encoding system, known as an abbreviation for the American Standard Code for
Information Interchange. Designed initially for old type computers and printers from telegraphic
codes, it was based on 128 symbols including 10 numbers, 26 letters of English alphabet, a
number of punctuation marks, etc.