Beruflich Dokumente
Kultur Dokumente
Lesson Objectives
What is system?
What is system?
Phases of SDLC
System Development Life Cycle
Preliminary Investigation
-problem definition
Implementation
-training
-conversion
-evaluation
-maintenance
Analysis
-gather data
-analyze data
-develop requirements
SDLC
Design
-preliminary design
-detail design
Development
-scheduling
-programming
-testing
Computer Program
Activities Involve in
Programming
Activities involve in
Programming
Understanding the Problem
Activities Involve in
Programming
Plan the Logic
The process of planning for the solution of the
problem.
They are referred to as ALGORITHMS
Two most common tools are FLOWCHARTS and
PSEUDOCODE.
Involves writing down steps (in English).
The programmer doesnt worry about syntax at this
point, just the sequence of events that will lead from
available input to the desired output.
Activities Involve in
Programming
Code the Program
Activities involve in
Programming
Compile the program into Machine Language
Activities involve in
Programming
Test the Program
To execute and then run the program. The program upon execution is
being subjected to different kinds of test data to anticipate and correct
errors that might occur before releasing the program to the users.
Errors can be classified into two: (1) syntactical or logical errors (2)
compile or run-time errors.
Activities involve in
Programming
Put the Program into Production
Algorithm
Example:
Prepare a Cup of Coffee
Characteristics of an Algorithm
Flowcharting
What is Flowcharting?
Flowcharting
Types of Flowcharts
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.
Flowcharting
Basic Flowcharting Symbols
Terminal block
Process symbol
Input/Output block
Decision symbol
On-page Connector
Off-page Connector
Initialization symbol
Flow lines
Flowcharting
Basic Flowcharting Symbols
Terminal
- used to signify the
beginning and end of
flowchart
OVAL
START
Flowcharting
Basic Flowcharting Symbols
Hexagon
SUM=0
PRODUCT=0
Preparation/Initialization
Flowcharting
Basic Flowcharting Symbols
Parallelogram
Read A
Print A
Input/Output
Flowcharting
Basic Flowcharting Symbols
Rectangle
Sum = A+B
Process/Processing
Flowcharting
Basic Flowcharting Symbols
Diamond
If x>5
Decision
Flowcharting
Basic Flowcharting Symbols
Small Circle
On-page Connector
Flowcharting
Basic Flowcharting Symbols
Pentagon
Off-page Connector
-designates entry or to
exit from one page when
a flowchart requires
more than one page.
Flowcharting
Basic Flowcharting Symbols
Flowlines
Flowcharting
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.
Flowcharting
Flowcharting
Rules in naming variables...
Must be one word.
May contain letters, numbers, hyphens,
underscores.
Must not start with a number.
Must not contain a space.
Must have some meaning.
Invalid Variable names
interest rate
rate!
Flowcharting
Types of Variables
Numeric Variables
The type of variable that can hold a number.
In this example: Answer = number * 2
Some languages allow additional types of data; Pascal and C
distinguish between integer or whole number numeric variables and
floating point, decimal and fractional numeric variables.
Character, Text or String Variables
Variables that can hold letters of the alphabet and other special
character such as punctuation marks.
Example:
NAME = WASHINGTON
Logical or Boolean Variables
A special type of variable that can only have two values - TRUE or
FALSE.
Flowcharting
Arithmetic Operators and Mathematical Statements
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Modulus (%)
Flowcharting
Constants
Flowcharting
Relational Operator
Operator
Use
Returns true if
>
>=
<
<=
==
op1 == op2
!= / not=
op1 != op2
Flowcharting
Logical Operators
Operator
Use
Returns true if
and
or
cond1 or cond2
not (negation)
not cond
! cond
ADVANTAGES OF USING
FLOWCHARTS
1. Communication: Flowcharts are better way of communicating the logic
of a system to all concerned.
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
LIMITATIONS OF USING
FLOWCHARTS
1.Complex logic: Sometimes, the program logic is quite
complicated. In that case, flowchart becomes complex and
clumsy.
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.
START
READ N
PRINT N
END
Algorithm:
Step 1: Read in the value of
N.
Step 2: Print the value of N.
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
Celsius=0
Read Fah
Celsius=(5/9)*
(Fah-32)
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
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
Print A,
Higher
F
Print B,
Higher
END
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
If Grade
>60
Remarks =
Failed
Remarks =
Passed
Print Name,
Grade, Remarks
END
SEATWORK
Pseudocode
Pseudocode