Professional Documents
Culture Documents
Computer Programming (M1-Main) PDF
Computer Programming (M1-Main) PDF
PROGRAMMING 1
MODULE 1
INTRODUCTION TO
PROGRAMMING
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 object-
oriented programming
• Identify the steps in program development
Programming is a multistep
process for creating a program.
LOW-LEVEL HIGH-LEVEL
Within a computer, all data is
represented by microscopic • Instructions written in 0s and
1s are called machine
electronic switches that can language or machine code.
be either OFF or ON.
• Each class of computer has its
• OFF switch is designated by
a 0. own particular machine
• ON switch is designated by language
a 1. • Writing in machine language
Example: is tedious!
0100 0001 = capital ‘A’
A programming language with
Assembly language programs
symbolic names for opcodes,
must be translated into machine
and decimals or labels for
instructions, using an assembler.
memory addresses
Example:
ADD 1, 2
MUL 2, 3
PROGRAMMING PARADIGM
A programming paradigm is a style, or “way,” of
programming to solve problem using some programming
language.
It is an approach or method to solve a problem using tools
and techniques that are available to us following some
approach.
It is also a way to classify programming languages based on
their features.
• Procedure-oriented program, the programmer concentrates
on the major tasks that the program needs to perform. The
programmer must instruct the computer every step of the way,
from the start of the task to its completion.
Example:
In a payroll program, the program typically performs several
tasks, such as inputting the employee data, calculating the
gross pay, taxes, net pay, and outputting a paycheck.
• Object-oriented program requires the programmer to
focus on the objects that the program can use to
accomplish its goal. The objects can take on many different
forms.
Example:
In Windows-based program, it typically use objects such
as check boxes, list boxes, and buttons.
PROCEDURAL PROGRAMMING OBJECT-ORIENTED PROGRAMMING
Where:
Rotate(shapeNum) and
playsound(shapeNum) are functions
Where:
Shape is the class; Circle, Rectangle and Polygon are the objects.
PROGRAM DEVELOPMENT
When we want to develop a program using any programming
language, we follow a sequence of steps. These steps are
called phases in program development.