Introduction To Programming and Flowcharting
Introduction To Programming and Flowcharting
PROGRAMMING LANGUAGE
INTRODUCTION TO
PROGRAMMING AND
FLOWCHARTING
PRESENTED BY:
Engr. Julie Ann H. Loresco
Machine Language
MACHINE LANGUAGE
the lowest level of programming language
only language understood by computers and
consists of pure numbers; takes the form of 1 or
0
each machine instruction has two (2) parts:
LOW-LEVEL LANGUAGE
also called assembly language and is similar to
machine language but assembly language is
much easier to understand than machine
language
Examples of mnemonic codes
9/30/2015
Fourth-generation
TRANSLATION
Programs today are normally written in one of
the high-level languages. To run the program on
a computer, the program needs to be translated
into the machine language of the computer on
which it will run. The program in a high-level
language is called the source program. The
translated program in machine language is called
the object program.
Two methods are used for translation:
compilation
interpretation
Compilation
Interpretation
9/30/2015
COMPILER
INTERPRETER
WHAT IS SYSTEM?
PHASES OF SDLC
Preliminary Investigation
-problem definition
Implementation
-training
-conversion
-evaluation
-maintenance
Analysis
-gather data
-analyze data
-develop requirements
COMPUTER PROGRAM
SDLC
Design
-preliminary design
-detail design
Development
-scheduling
-programming
-testing
9/30/2015
ACTIVITIES INVOLVED IN
PROGRAMMING
1.
2.
3.
4.
5.
6.
WHAT IS FLOWCHARTING?
Flowcharting
WHAT IS FLOWCHARTING?
Types of Flowchart
Program Flowcharts
Depicts the detailed logical flow of process in a
program.
System Flowcharts
Shows the logic flow of data from one source to
another.
Divided into functions of departments or personnel.
Symbols are used to represent documents used and
operations undertaken.
Highlights excessive information flow, duplication of
information stored in different locations and reasons
for delay of transactions.
Input/Output block
Decision symbol
On-page Connector
Off-page Connector
Initialization symbol
Flow lines
Flowcharting
Flowcharting
OVAL
START
Preparation / Initialization
- signifies the preparation of
data
- Used to select initial conditions
- Used to represent instructions
or group of instructions that
will alter or modify a programs
course of execution
Terminal
Hexagon
SUM=0
PRODUCT=0
9/30/2015
Flowcharting
Flowcharting
Input
/ Output
-shows input and output.
Data are to be read into
the computer memory
from an input device or
data are to be passed
from the memory to an
output device.
Parallelogram
Read A
Print A
Process
Rectangle
Sum = A+B
Flowcharting
Flowcharting
Decision
-signifies any decisions that are
to be done. Two alternative
execution paths are possible.
The path to be followed is
selected during the execution
by testing whether or not the
condition specified within the
outline is fulfilled.
Diamond
If x>5
On-page Connector
- show the entry or exit point of
the
flowchart.
A
nonprocessing symbol used to
connect one part of a flowchart
to another without drawing
flow lines. Conserves space by
keeping related blocks near
one another, reduces the
number of flow lines in
complex
program
and
eliminates cross lines from
taking place.
/ Processing
Small Circle
Flowcharting
Flowcharting
Off-page
Pentagon
Connector
-designates entry or to exit
from one page when a
flowchart requires more than
one page.
Flowlines
9/30/2015
ADVANTAGES OF USING
FLOWCHARTS
LIMITATIONS OF USING
FLOWCHARTS
Flowcharting
DRAW A FLOWCHART
Basic Flowcharting
Almost every program involves the steps of input,
processing and output.
Example:
Get number
Answer = number *2
Print Answer
Most flowcharts need some way to separate each step.
Drawing different boxes around each statement is the
standard convention.
Input operation are represented in a parallelogram. A
statement in English is written inside the parallelogram.
DRAW A FLOWCHART
START
Sum = 0
Product = 0
Read A,B
Sum = A + B
Product = A * B
Algorithm:
Step 1: Initialize Sum and
Product into 0.
Step 2: Read in the values of A
and B.
Step 3: Compute the sum by
adding A and B then compute
the product by multiplying A
and B.
Step 4: Print the computed
value of Sum and Product.
Print Sum,
Product
END
START
READ N
Algorithm:
Step 1: Read in the value of N.
Step 2: Print the value of N.
PRINT N
END
START
Celsius=0
Read Fah
Celsius=(5/9)*
(Fah-32)
IN
Algorithm:
Step 1: Initialize Celsius into 0.
Step 2: Read in the value of
Fahrenheit.
Step 3: Compute the value of
Celsius.
Step 4: Print the computed
value of Celsius.
Print
Celsius
END
9/30/2015
DRAW
A AND B. COMPARE
TWO VALUES
INPUTTED AND PRINT WHICH OF THE VALUES IS HIGHER INCLUDING THE REMARK
DRAW
HIGHER.
Algorithm:
Step 1: Read the values of A and B.
Step 2: Test if A is greater than B.
Step 3: If A is greater than B, A is
higher. However, if A is less than
B, B is higher.
Step 4: Print the number and the
remark Higher
START
Input A,B
A>B
START
Name=
Remarks =
Algorithm:
Step 1: Initialize name and remarks into
blanks.
Step 2: Read in values for Grade and Name.
Step 3: Test if Grade is greater than or equal to
60.
Step 4: If Grade is greater than or equal to 60,
remark is Passed. However, if Grade is
below 60, remark is Failed.
Step 5: Print the name, grade and remarks.
Read Name,
Grade
Print A,
Higher
F
Print B,
Higher
PRINT THE
STUDENT.
END
If Grade
>60
Remarks =
Failed
Remarks =
Passed
Print Name,
Grade, Remarks
END