Pseudo Code and Flow Chart
Pseudo Code and Flow Chart
Introduction
Introduction
1. Problem Understanding
Before we can solved a given problem, we have to
carefully understand things that will be solved
2. Problem Analysis
Analyze the problem by determining 3 important things:
1. input for the program
2. processing steps to transform input to output (including
rules and constraint that will be considered and also all the
formula involved)
3. output produced
3. Algorithm Design
Algorithms refer to a procedure to solve problem that involved
steps/commands that has to be executed
Each algorithms has the following properties:
clear and unambiguousness lack of confusion)
Has a general characteristic which can accept all set of data
Accuracy in solving a problems as required
Have an ending
have input and produce output
Have 2 ways to represent algorithms
1. Pseudo code algorithm explanation in a wording form by using all
kind of language that can be understand by the programmer
2. Flow chart- a graphically program logic illustration that is
connected by using arrows
Meaning
Process command execution that transform input
to output
Input / output data entered or result displayed
4. Implementation
After designing algorithm, then we can write and type the program
code to computer. Here we can use a computer programming
language
5. Testing
Programs that has been developed must be tested first by using
several different input to ensure the needs of problem that being
solved is fulfill
6. Maintenances
In an organization that use a computer program, some programs
maybe need a change from time to time to fulfill current needs
HOW TO PRODUCE
THE PSEUDOCODE
& THE FLOW CHART
- CLASS DISCUSSION-
Solution Step
Understand the question, the determine input, output
and formulas that will be used
Algorithm design by developing pseudo code and flow
chart
Solution Step
Understand the question, the determine input, output
and formulas that will be used
Algorithm design by developing pseudo code and flow
chart
gross salary
Process
Output
net salary
No
Gross Salary
>= 1000
Tax = 0
Yes
END
Action 1
Action 2
Action 3
Condition
Action 1
Action 2
Selection control structure is used when it involve conditions for example ifelse condition. This condition must be in 2 situation which is either yes/true if it
fulfill the condition and no/false if vice versa.
Action 1
no
Condition /Case
2
Situation 2
yes
Action 2
no
Condition /Case 3
Situation 3
yes
Action 3
no
LETS DO IT TOGETHER...
Write the problem analysis and design the flow
chart.....
The Fantastic Floral Company sells to
wholesale buyers. The following are the
discounts to the wholesale buyer:
AMOUNT < RM1000
DISCOUNT=2%
AMOUNT >=RM1000 AND <RM5000 DISCOUNT=5%
AMOUNT >= RM5000
DISCOUNT=10%
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
1. Compute money exchange rate from USD to RM
(1 USD = RM 3.80)
2. Compute average marks for 10 students from
Programming in Business Application course
3. Determine the least number from 3 number entered
4. Determine number entered by user is positive, negative or
null value
5. Compute the amount paid by user for petrol quantity
bought (user input is in liter quantity)
Note :
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
6. Develop a program to display the status of current
temperature. Temperature status displayed is based on
the followings:
Temperature (Celsius)
Status
0-30
Cold
30-50
Medium
50-70
Hot
70-100
Very Hot
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
7. Develop an application to compute the payment of
electricity consumption. Input use early meter reader and
late meter reader. Payment rate required are as
followings:
First 100 unit
RM 20.00
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
8. Develop an application to calculate income zakat
payment that are required to pay by the user. Payment
rate are as followings:
Annual income less than
RM 4000
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
9. Pos Malaysia have fixed the payment cost for every
posted parcel are as the following table. Develop an
application to compute posted payment cost based on
weight entered
Weight (kg)
Cost (RM)
0-2
2.50
2.1 - 5
3.80
5.1 - 10
6.00
10.1 - 20
10.00
Greater than 20
Void
Exercise
Develop programs for the following problems: (you are
required to provide problem analysis and flow charts)
10. Calculate average marks for every student from three
test. Determine the grade and status for average marks
produce. Grading table are as following
A
81 100
Distinction
61 80
Good
51 60
Satisfaction
40 50
Pass
0 39
Fail