Module 1 Continuation
Module 1 Continuation
Module 1 Continuation
Objectives
Upon completion of this module, you will be able to:
Define what is computer programming
Define terms related to computer programming such as
source code, programs, etc.
Know the difference between an Assembly Language
and Machine Language
Describe what are the low and high-level languages
Know the difference between procedural and objectoriented programming
Objectives
Computer Program
A computer program (also a software program, or just
Source Code
Source code is text written in a computer programming
language. Such a language is specially designed to
facilitate the work of computer programmers, who specify
the actions to be performed by a computer mostly by
Computer Programming
Computer programming (often shortened to programming or coding)
is the process of designing, writing, testing, debugging/ troubleshooting,
Introduction to Programming
Program: self-contained set of
instructions used to operate a computer to
produce a specific result
Also called software
Machine Language
Machine language programs, also called
executables, consist of binary instructions
Each instruction has two parts:
Instruction part: the operation to be performed;
also called an opcode
Address part: memory address of the data to be
used
Each class of computer has its own particular
machine language
Writing in machine language is tedious!
8
Assembly Language
Assembly Language: programming language
with symbolic names for opcodes, and decimals
or labels for memory addresses
Example:
ADD
MUL
1, 2
2, 3
10
Introduction to Programming
Low-level languages: languages that use
instructions tied directly to one type of computer
Examples: machine language, assembly language
High-level languages: instructions resemble
written languages, such as English,and can be run
on a variety of computer types
Examples: Visual Basic, C, C++, Java
11
Introduction to Programming:
(continued)
Source code: the programs written in a high- or
low-level language
Source code must be translated to machine
instructions in one of two ways:
Interpreter: each statement is translated
individually and executed immediately after
translation
Compiler: all statements are translated and
stored as an executable program, or object
program; execution occurs later
12
Figure 1.2
Creating an
executable C++
program.
15
History of C++
During the 60s
ALGOL 60, was developed as an alternative to
FORTRAN taking from it some concepts of
structured programming which would later inspire
most procedural languages.
ALGOL 68 also directly influenced the
development of data types in C. Nevertheless
ALGOL was an non-specific language and its
abstraction made it impractical to solve most
commercial tasks.
Advantages of C++
1. C++ allows expression of abstract ideas
2. C++ still allows a programmer to keep low-level
control
3. C++ has national standards (*ANSI)
4. C++ is reusable and object-oriented
5. C++ is widely used and taught
*ANSI: American National Standard Institute
int main()
{ printf( "Hello, World" );
return 0;
}
End of Module 1