You are on page 1of 3

TYPES OF PROGRAMMING • Debugging - the process of locating and

correcting the errors of a program.


Computer program – set of instructions for a
computer to follow. PROGRAMMING CYCLE
Programming – process of planning and Algorithm - It is a problem-solving technique
creating a program. used in solving programming problems. It is a
step-by-step problem-solving process in which
Low-level Languages – languages that deal
a solution is arrived at in a finite amount of
with a computer’s hardware components.
time.
• Machine Language – the most basic set of
The problem-solving process in the
instructions that the computer can execute. It is
programming environment involves the
written in binary codes (0 , 1).
following steps:
• Assembly Language - a symbolic form of
1. Problem Analysis: Analyze the problem and
machine language that is easier for people to
outline the problem and its solution
read, such as ADD AX DX. This makes use of
requirements.
instructions in mnemonic form.
2. Algorithm Design: Design an algorithm to
○ Assembler - program that translates
solve the problem.
assembly language instructions into machine
language. 3. Coding: Implement the algorithm in a
programming language.
High-level Languages – programming
languages that use natural languages, such as 4. Execution: Verify that the algorithm works.
the English language. A high- level language
PROBLEM ANALYSIS-CODING-
has its own syntax.
EXECUTION CYCLE :
• Syntax – rules of the language, for example, A
print or write is used to produce an output.
Error

• Commands - program statements that carry


Problem Analysis Algorithm Coding Compiler
out tasks that the program has to perform, for Design

example, print this word or add these two (2)


No Error
numbers.
• Compiler - program that translates a program No Error
Interpreter Machine Machine
Code Code
written in a high-level language into a low-
level language before executing the program Error

statements. Library
Results

• Interpreter - acts as a compiler, but it A

translates one (1) program statement at a time,


this executes the statement as soon as it is
translated.
• Syntax errors - errors that might be
encountered during the process of translation.
An example is a misspelled command.
• Logical errors - errors that occur when the
syntax of the program is correct, but the
expected output is not.
An algorithm must be expressed completely in Example: Using the example problem in the
a natural language that anyone can follow, algorithm.
such as directions that can be written in the
The pseudocode to find and display the
English language.
volume of rectangle is:
Example:
READ length.
Design an algorithm that finds and displays the
READ width.
volume of a rectangle. It is required to know
the rectangle’s length, width, and height, and READ height.
the formula to know the rectangle’s volume.
The formula is volume = length × width × SET volume to 0.kkk
height. COMPUTE volume as length * width * height.
The algorithm to find and display the volume PRINT volume.
of the rectangle is:
Flowchart – is a visual representation of an
1. Get the length of the rectangle. algorithm. It contains shapes describing how
2. Get the width of the rectangle. an algorithm or program operates. Each
command is placed in an appropriate shape,
3. Get the height of the rectangle. and arrows are used to direct program flow.
4. Find the volume using the formula: volume Flowchart shapes represent various operations.
= length × width × height. These shapes are connected by directed lines
to indicate the flow of data or control from one
5. Display the computed volume.
(1) point to another.
2 Commonly used tools in representing an
algorithm Flowchart Shape Function
Flow lines: Used to indicate the
Pseudocode – is a method of describing direction of the process flow by
connecting other shapes. Arrows
computer algorithms using a combination of should not cross each other.
natural language and programming language. Terminal block: Used to
It is a technique to show the programming represent the beginning or
steps. end of a program.
Process: Used to represent
The following are some rules that are
a process step or activity,
frequently followed when writing pseudocode: such as computation,
• Symbols are used for the following common initialization, etc.
operations: Data: This represents the
data used as inputs or
o Arithmetic operations (+, -, *, /) outputs, such as user input
and display text.
o Assignment (=) Decision block: This
indicates a decision
o Comparison (=, ≠, <, >, ≤, ≥)
operation in the process,
o Logical (and, or) where there are two (2)
alternatives: true and false.
• Certain keywords can be used as a command, Connector: Used as a
such as PRINT, WRITE, READ, SET, GO connector to combine flow
TO, etc. lines by indicating an
identifier, such as letters.
• Indentation is used to indicate branches and This is used for complex
loops of instructions. algorithms.
Functio
Predefined Process:
Indicates the use of an
algorithm specified outside Data
the program, such as
methods or functions.

Example:
Using the example problem in the algorithm
The flowchart to find and display the volume Function
Data 4 Function
Data 5
of the rectangle is:

Start Object-Oriented Programming – in this approach,


programs are organized around objects rather than
READ length, width, height
actions, and data rather than logic. The solution
resolves around entities or objects that are part of the
problem. It deals with how to store data related to the
Volume = length entities, how the entities behave, and how they
X width x height interact with each other to give the desired result.

• OBJECT-ORIENTED
PRINT volume

Object 1 Object 2
Method Method
End Data Data

Programming Methodologies
Programming methodology – is the approach
to analyzing such complex problems by Object 3
planning software development and
Method
controlling the development process.
Data
2 Popular Approach to Writing Computer
Program
Procedural Programming – in this approach,
the problem is broken down into functions that
perform one (1) task each. This approach is
suitable only for small programs that have a
low level of complexity.
• PROCEDURAL
Main Program

Function 3

Data

Function 2

Data

You might also like