Professional Documents
Culture Documents
AN OVERVIEW
At present, there are over 200 programming languages; these are the
ones that are still being used.
IN
WRITING
P R O G R AM
In this step you break the problem into its basic components for
analysis.
3. Design the general logic or algorithm of the program.
Lecture in C++
PROGRAMMING LANGUAGE
It is a set of rules that provides a way of telling a computer what
operation to be performed.
In most programming language, a computer is instructed to
accept data, store the data, do basic arithmetic operations,
display or print data, and repeat instruction automatically.
LEVELS
1. Machine Language
It is considered very low level they are not convenient for people to
use as more recent language
3. High-Level Language
PROGRAM DESIGN
AND
TECHNIQUE
Flowchart does not highlight the important details since each step
receives as much attention in a flowchart as any other.
TYPES
1.
OF
F L O W C H AR T
System Flowchart
It sometimes called a Run Diagram or a Purpose Diagram.
PSEUDOCODE
Example:
Add A and B and store the result to C
Divide N by 3 and assign the result to X
5.
F L O W C H A RTI N G
It is a diagram representing the logical sequence in which a
combination of steps or operation is to be performed.
It consists of labeled geometric shapes that are interconnected to
provide a pictorial representation of data processing procedure.
The predefined graphic symbols of a flowchart are used to indicate
the various operations and the flow of control.
L I M I T AT I O N :
1.
3.
4.
2.
Program Flowchart
It is one designed to portray the various arithmetic and logic
operations that must be accomplished to solve a data
processing problem.
It helps the programmer to visualize the job and aids him in
planning the sequence of instruction he must write for the
machine.
F L O W C H AR T I N G S Y M B O L S
The following set of symbols that can be used doe systems and
program flowcharts conform to the International Organization
for Standardization (ISO) and American National Standard
Institution (ANSI)
TERMINAL SYMBOL indicates the STARTing and
ENDing point of a flowchart.
It is also used to signal an interruption in the
program flow.
INITIALIZATION SYMBOL assigns the initial values
of the variables, usually 0 (zero) for numeric and
(null) for string
INPUT/OUTPUT SYMBOL represents an instruction
Lecture in C++
Page 2 of 6
to be processed.
It is used for input and print command.
PROCESSING
SYMBOL
executes
operation and calculations.
arithmetic
Comparison
()
Grouping
Logical OR
&
Logical AND
= or EQ
Equal to
> or GT
Greater than
< or LT
Less than
<> or NE
Not Equal to
>= or GE
<= or LE
in
which
Yes
No
EOF
End of File
Y
N
SEQUENCE STRUCTURE
It indicates that control flows from processing box to another.
It represents events that occur immediately one after another.
F L O W C H AR T :
Start
F L O W C H AR T I N G N O TATI O N S
Lecture in C++
NOTATION
MEANING
Addition
Subtraction
Multiplication
Division
* * or
Exponentiation
End
Page 3 of 6
PROBLEM:
Given the three numbers A, B, and C. Make an algorithm and
draw a flowchart to compute and print out the sum, average,
and product of these values.
SELECTION STRUCTURE
It is used to test a condition and provide for a choice of one
between two alternatives.
F L O W C H AR T :
Pseudocode:
Start
1.
2.
3.
4.
5.
Flowchart:
Y
N
Cond
n
End
Start
PROBLEM:
Read
A, B, C
SUM = A + B + C
AVE = SUM / 3
PRO = A * B * C
PRINT SUM,
AVE, PRO
2.
3.
4.
End
Flowchart:
Lecture in C++
Page 4 of 6
Input
GRADE
been performed.
N
NGRADE = GRADE +
5
F
Print
NGRADE
Before the logic gets out of loop, a loop terminating condition must first
be satisfied.
F L O W C H AR T :
End
Start
LOOPING STRUCTURE
Y
Condn
M E C H AN I S M :
PROBLEM
Juan Kulit was punished for being talkative in his typing class.
He has to type I PROMISE TO BE MORE ATTENTIVE 500
times. Juan finished the task in 1 minute. How did he do it?
Pseudocode:
1.
2.
3.
4.
5.
Flowchart:
Start
CTR = 1
F
Print
I PROMISE TO BE
MORE ATTENTIVE
CTR = CTR + 1
CTR <=
500
N
End
Lecture in C++
Page 6 of 6