Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
103 views

Visual Basic Programming Handouts-Part1

This document provides an introduction to computer programming concepts for 10th grade students at the University of Santo Tomas Junior High School. It defines what a computer program is, explains that programming involves writing instructions for computers in a programming language, and discusses different types of programming languages from low-level to high-level languages. The document also covers basic programming terminology like variables, statements, compilers, and generations of programming languages.

Uploaded by

Martin Reapor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Visual Basic Programming Handouts-Part1

This document provides an introduction to computer programming concepts for 10th grade students at the University of Santo Tomas Junior High School. It defines what a computer program is, explains that programming involves writing instructions for computers in a programming language, and discusses different types of programming languages from low-level to high-level languages. The document also covers basic programming terminology like variables, statements, compilers, and generations of programming languages.

Uploaded by

Martin Reapor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

UNIVERSITY OF SANTO TOMAS JUNIOR HIGH SCHOOL

TECHNOLOGY AND LIVELIHOOD EDUCATION


COMPUTER PROGRAMMING FOR GRADE 10

Cristy Tungpalan
SY 2016-2017
INTRODUCTION TO PROGRAMMING
PROGRAMMING CONCEPTS

What is a Computer Program?

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.

What Is a Programming Language?


People express themselves using a language that has many words. Computers use a simple
language known as machine codes that consists of only 1s and 0s, with a 1 meaning "on" and a 0
meaning "off" also known as machine language. Machine Language is the elemental language of
computers, comprising a long sequence of binary digital zeros and ones (binary digits or bits).
Machine language is the only language a computer is capable of understanding.

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

A compiler is a special program that processes statements written is a particular programming


language and turns them into machine language or “code” that a computer’s processor uses.

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.

A lower level language is used in two generations of computer.

First Generation Languages or 1GL

The lowest level of language used to program the 1st generation


computers. The instructions in 1GL are made of binary numbers,
represented by 1s and 0s. “1” and “0” correspond to “on” and “off”
states of electrical switches. Suitable for the understanding of the
machine but very much difficult to interpret and learn by the human
programmer.

Second Generation Languages or 2GL


Represent a step up from the first generation languages. Allow for the use
of symbolic names instead of just numbers. These observations are called
Mnemonics. These Mnemonics are Opcode and Operands. Second
generation languages are known as assembly languages. Code written in
an assembly language is converted into machine language (1GL).

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.

Third Generation Languages or 3GL (High-Level Languages)


With the languages introduced by the third generation of computer programming, words and
commands (instead of just symbols and numbers) were being used. These languages
therefore, had syntax that was much easier to understand.

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.

Selecting a Programming Language

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.

Computer Storage and Memory


Computer memory is often measured in kilobytes (KB), megabytes (MB) and gigabytes (GB). Kilo,
mega and giga are some of the prefixes used with ‘bytes’ and have corresponding values.

Computers count by base 2 (binary number system):

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:

Unit Equivalent (in bytes)


10
1 kilobyte (KB) 2 = 1,024 bytes
1 megabyte (MB) 220 = 1,048,576 bytes
1 gigabyte (GB) 230 = 1,073,741,824 bytes
1 terabyte (TB) 240 = 1,099,511,627,776 bytes
1 petabyte (PB) 250 = 1,125,899,906,842,624 bytes
Computer Coding System
There are two coding systems used, namely Extended Binary Coded Decimal Interchange Code
(EBCDIC) and American Standard Code for Information Interchange (ASCII).
Extended Binary Coded Decimal Interchange Code (EBCDIC) is an eight-bit character
encoding used mainly on IBM mainframe and IBM midrange computer operating systems.

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.

You might also like