PROGRAMMING 1-
(ITFLO2C)
Prepared by:Jocelyn M. Tanay-Lipata
Overview of Computer Programming Language
PROGRAM
– a set of step by step
instruction that directs the
computer to do the task
you want it to do and to
produce the result wanted.
Programming Language
Standardized
COMMUNICATION technique
for expressing INSTRUCTIONS
to a computer.
Set of COMMANDS that is
formulated by the user and
executed by the computer.
Categories of Programming Language
HIGH-LEVEL
•- A Programming Language
that is more USER-
FRIENDLY
- PLATFORM-
•
INDEPENDENT
- Ex: Java, C, C++, Basic,
•
• Fortran
Categories of Programming Language
LOW-LEVEL
•- Assembly languages are
similar to machine
languages, but they are
much easier to program
because they allow
programmer to substitute
names for numbers.
What Programmers Do?
Makes / executes programs.
Converts problems and solution to
computer instruction.
Prepares instruction of program, runs,
tests and debug the program
Write a report on the program
Helps the user develop new program to solve
problems.
Click icon to add picture
Widescreen Pictures
Pictures can also be presented more dramatically in widescreen.
The Program Development Life
Cycle
Testing the
Problem
Coding
Planning &the
Solution
Definition
Program
Debugging
D
oc
u
m
en
ti
ng
th
e
Pr
og
ra
m
The Program Development Life
Cycle
Problem Definition
The problem must be well and clearly
defined first in terms of its input and output
requirements.
Sample Problem:
“Create a program that will determine the
number of times a name occurs in a list”
The Program Development Life
Cycle
Program Requirement:
Determine the number of times a name occurs in a list
Input:
list of name, name to look for
Process:
count the number of times the name occurred
Output:
the NUMBER of times the name occurs in a list
The Program Development Life
Cycle
Planning the Solution
Select the best method for solving the problem.
Algorithm/ Pseudocode
-A clear and unambiguous specification of the steps
needed to solve a problem. It may be expressed in
Human language.
The Program Development Life
Cycle
Planning the Solution
Flowcharting
-A graphic representation of an algorithm,
often used in the design phase of programming
to work out the logical flow of a program.
Sample Problem:
“Create a program that will determine the
number of times a name occurs in a list”
Solve the Problem using the following method:
a. Algorithm
b. Pseudocode
c. Flowchart
a. Algorithm
1. Get the List of Names
2. Get the name to look for, lets call this the keyName.
3. Compare the keyName to each of the name in the list.
4. If the keyName is the same with a name in the list, add
1 to the count.
5. If all the names have been compared, output the result.
b. Pseudocode
Let nameList = List of Names
Let keyName = the name to be sought
Let count = 0
For each in the nameList do the following:
If name = = keyName
count = count + 1
Display count
START
c. Flowchat
Get
nameList
Get
keyNam
e
STOP count = 0
NO YES
Display More Name =
count names? keyName?
YES
NO count = count + 1
Flowcharting
Flowcharting
The Connector Symbol represents the exit to, or entry
from, another part of the same flowchart. It is usually used to
break a flow line that will be continued elsewhere. It's a
good idea to reference page numbers for easy location of
connectors.
Offpage Connector Symbols are used to indicate the
flowchart continues on another page. Often, the page number
is placed in the shape for easy reference.
Flowcharting
Flowcharting
GUIDELINES IN FLOWCHARTING
1. In drawing a proper flowchart, all necessary requirements should
be listed out in logical order.
2. The flowchart should be clear, neat and easy to follow. There
should not be any room for ambiguity in understanding the
flowchart.
3. The usual direction of the flow of a procedure or system is from left
to right or top to bottom.
.
Flowcharting
4. Only one flow line
should come out from
a process symbol
OR
Flowcharting
5. Only one flow line should enter a decision
symbol, but two or three flow lines, one for each
possible answer, should leave the decision symbol.
Flowcharting
6. Only one flow line is
used in conjunction with
terminal symbol.
Flowcharting
7. If the flowchart becomes complex, it is better to use connector
symbols to reduce the number of flow lines. Avoid the intersection
of flow lines if you want to make it more effective and better
way of communication.
8. Ensure that the flowchart has a logical start and finish.
9. It is useful to test the validity of the flowchart by passing
through it With a simple test data.
The Program Development Life
Cycle
Coding the Program
Prepare the set of instructions
for the program to execute
The Program Development Life
Cycle
Testing & Debugging
Performs testing if the
program
always performs its task
without failure
Directs, locates & correct bugs
by running the program
The Program Development Life
Cycle
Documenting the Program
Write up the full specifications
for other program user.
Used to make program
readable by other
programmers.
Group Dynamics:
Solve the given problem by using the ff. methods:
a. Algorithm/pseudocode
b. Flowchart
Group 1 – Baking a Cake
Group 2 - Growing a Plant
Group 3 – Playing Basketball
Group 4 – Enrolling in a Universiity