Вы находитесь на странице: 1из 7

9/30/2015

PROGRAMMING LANGUAGE

INTRODUCTION TO
PROGRAMMING AND
FLOWCHARTING

PRESENTED BY:
Engr. Julie Ann H. Loresco

CATEGORIES OF PROGRAMMING LANGUAGES

Machine Language

Language is defined as a system for communicating.


Written language use symbols (characters) to build
words.
The entire set of words is the language vocabulary.
The language syntax and grammar define the way
in which the words are meaningfully combined.
The actual meaning of words and combinations of
words is defined by the language semantics
A computer language is a set of predefined words that
are combined into a program according to predefined
rules (syntax).

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

High Level Language

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

op code (operation code) - which tells the


computer what function to perform
operand - which tells the computer what data to use
when performing the function

HIGH-LEVEL PROGRAMMING LANGUAGE


enables a programmer to write programs that are
more less independent of a particular type of
computer
considered high-level because its closer to human
language than the machine language that the
computer understands
easier to understand and allows the programmer
to focus on solving the problem rather than
knowing how to program the computer

9/30/2015

HIGH-LEVEL PROGRAMMING LANGUAGE

HIGH-LEVEL PROGRAMMING LANGUAGE

Third-generation languages (3GLs) are the first


to use true English-like phrasing, making them
easier to use than previous languages.
3GLs are portable, meaning the object code
created for one type of system can be translated
for use on a different type of system.
The following languages are 3GLs:

Fourth-generation

First introduced in FORTRAN, ALGOL and COBOL


Most popular general purpose languages such as C ,
C++, C#, Java, Basic and Pascal

although C++, Java and C# follow a completely different


path as they are object-oriented in nature. Third generation
focused on structured and had no meaning for the object
encapsulation concepts

HIGH-LEVEL PROGRAMMING LANGUAGE

Fifth-generation languages (5GLs) are an issue of


debate in the programming community some
programmers cannot agree that they even exist.
These high-level languages would use artificial
intelligence to create software, making 5GLs
extremely difficult to develop.
Solve problems using constraints rather than
algorithms, used in Artificial Intelligence like
Prolog

COMPILATION & INTERPRETATION

Visual Basic (VB)


VB.net
Visual Foxpro
Prolog
SQL
MySQL

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

INTERPRETERS & COMPILERS

Compilation

languages (4GLs) are even


easier to use than 3GLs.
4GLs may use a text-based environment (like a
3GL) or may allow the programmer to work in a
visual environment, using graphical tools.
The following languages are 4GLs:

A compiler normally translates the whole source program into


the object program

Interpretation

Some computer languages use an interpreter to translate the


source program into the object program. Interpretation refers
to the process of translating each line of the source program
into the corresponding line of the object program and
executing the line

9/30/2015

COMPILER

INTERPRETER

a program that translates a program written in a


high-level language (source code) and
translates it into machine language (object
code)
the advantages and disadvantages of a compiled
code over an interpreted code are the following:

Compiled machine codes run much faster than


interpreted ones
Compiled codes occupy less memory during execution
Once a program is compiled it can be rerun anytime
The program can only be executed once the
translation is complete
Any change to the source code requires a complete
recompilation

WHAT IS SYSTEM?

translates and executes the program line by line


translates
high-level
instructions
into
an
intermediate form, which it then executes
the advantages and disadvantages of an interpreter
are the following:

The interpreter program is loaded into memory along with


the program source code so it uses more memory then
compiled codes
No copy of the translated code exist; if you want to re-run
the program it must be interpreted all over again
Interpreted codes are much slower than compiled codes
It is faster and easier to detect errors in the interpreted
program than the compiled program
It is easier and faster to make changes to the program
which makes development time faster especially for large
programs

PHASES OF SDLC

Is an organized set of related components


established to accomplish a certain task.
Note: There are natural systems such as the
bodys cardiovascular system but many systems
have been planned and deliberately put into
place by people.
For example: a fast-food franchise has a system
of serving a customer including taking an order,
assembling the food and collecting the amount
due.

System Development Life Cycle

1. Preliminary Investigation: Determining the problem


2. Analysis: Understanding the existing system
3. Design: Planning the new system
4. Development: Doing the work to bring the new system
into being

5. Implementation: Converting the new system

Preliminary Investigation
-problem definition

Implementation
-training
-conversion
-evaluation
-maintenance

Analysis
-gather data
-analyze data
-develop requirements

COMPUTER PROGRAM

Is a set of detailed, step-by-step instructions that


directs the computer what you want it to do. It is
a notation for expressing instructions to be
carried out by a computer.

SDLC
Design
-preliminary design
-detail design

Development
-scheduling
-programming
-testing

Programs are written in a programming


language, which is a set of rules that provides a
way of telling the computer what operations to
perform.
The person who creates computer program is
called computer programmer.

9/30/2015

ACTIVITIES INVOLVED IN
PROGRAMMING
1.
2.
3.
4.
5.
6.

Understand the problem.


Plan the logic.
Code the program.
Compile the program into machine language.
Test the program.
Put the program into production.

WHAT IS FLOWCHARTING?

A graphical representation of the logical steps that


solves a problem.

Use of symbol and phrases to designate the logic of


how a problem solved.

A common method for defining the logical steps of flow


within a program by using a series of symbols to identify
the basic input, process and output (IPOs) function
within a program.

A diagram representing the logical sequence in which a


combination of steps or operation is to be performed. It
is a blueprint of the program.

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.

BASIC FLOWCHARTING SYMBOLS


Terminal block
Process symbol

Input/Output block

Decision symbol

On-page Connector

Off-page Connector

Initialization symbol

Flow lines

Flowcharting

Flowcharting

BASIC FLOWCHARTING SYMBOLS

BASIC FLOWCHARTING SYMBOLS

OVAL

START

used to signify the


beginning and end of
flowchart

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

BASIC FLOWCHARTING SYMBOLS

BASIC FLOWCHARTING SYMBOLS

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

-performs any calculations


hat are to be done.

Sum = A+B

Flowcharting

Flowcharting

BASIC FLOWCHARTING SYMBOLS

BASIC FLOWCHARTING SYMBOLS

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

BASIC FLOWCHARTING SYMBOLS

BASIC FLOWCHARTING SYMBOLS

Off-page

Pentagon

Connector
-designates entry or to exit
from one page when a
flowchart requires more than
one page.

Flowlines

-signifies the process that


is to be executed next

9/30/2015

ADVANTAGES OF USING
FLOWCHARTS

LIMITATIONS OF USING
FLOWCHARTS

1. Communication: Flowcharts are better way of communicating the


logic of a system to all concerned.

1. Complex logic: Sometimes, the program logic is quite


complicated. In that case, flowchart becomes complex
and clumsy.

2. Effective analysis: With the help of flowchart, problem can be


analyzed in more effective way.
3. Proper documentation: Program flowcharts serve as a good
program documentation, which is needed for various purposes.
4. Efficient Coding: The flowcharts act as a guide or blueprint during
the systems analysis and program development phase.
5. Proper Debugging: The flowchart helps in debugging process.
6. Efficient Program Maintenance: The maintenance of operating
program becomes easy with the help of flowchart. It helps the
programmer to put efforts more efficiently on that part

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

THAT WILL COMPUTE AND DISPLAY THE SUM AND


PRODUCT OF TWO NUMBERS.

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

2. Alterations and Modifications: If alterations are


required the flowchart may require re-drawing
completely.
3. Reproduction: As the flowchart symbols cannot be
typed, reproduction of flowchart becomes a problem.
4. The essentials of what is done can easily be lost in the
technical details of how it is done.

END

START

READ N

THAT WILL ACCEPT AND DISPLAY A NUMBER.

Algorithm:
Step 1: Read in the value of N.
Step 2: Print the value of N.

PRINT N

END

CONSTRUCT A FLOWCHART THAT WILL CONVERT AN INPUTTED NUMBER


FAHRENHEIT TO ITS EQUIVALENT MEASURE IN CELSIUS.
FORMULA: C = (5/9)*(F-32)

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 FLOWCHART THAT WILL INPUT VALUES FOR

A AND B. COMPARE

TWO VALUES

INPUTTED AND PRINT WHICH OF THE VALUES IS HIGHER INCLUDING THE REMARK

DRAW

A FLOWCHART THAT WILL INPUT GRADE OF STUDENT AND DETERMINE WHETHER

THE GRADE IS PASSED OR FAILED.

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

NAME, GRADE AND REMARKS OF

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

Вам также может понравиться