Professional Documents
Culture Documents
LG2 - Writing An Algorithm, Pseudocode and Flowchart
LG2 - Writing An Algorithm, Pseudocode and Flowchart
grade
Visual Basic
Computer Grade 10
PRAYER
Loving Father,
Come be with us today
Fill our hearts with joy
Fill our minds with learning
Fill our lessons with fun
Fill our friendships with kindness
Fill our school with love
Help us grow in love and kindness
more like Jesus everyday
Amen.
Writing an Algorithm,
Pseudocode, and Flowchart
“A good programmer is a good
planner”
Do you still remember the
steps in solving Math
problems?
Solving Programming Problems
0101010101
1101010110
Human 111001010101
PROBLEM Instructions SOLVE
110100011111
Program Code
0101010101
Process in Solving Programming Problems
PROBLEM
ANALYSIS
ALGORITH
M
LIBRARY CODING
COMPILER
LINKER
EXECUTION
OUTPUT
Library
is a collection of resources or routines used by computer programs
Algorithm
is a step-by-step procedure to solve problems.
Pseudocode
is a description of an algorithm using a natural language, which makes reading of program easier.
Flowchart
is a diagram representing the logical sequence in which a combination of steps or operaions is to
be performed.
Basic Symbols Used in
Flowcharting
1. Terminator
this is used in declaring the beginning and the end of the flowchart.
Labeled with the word “Start” or “End”
2. Input / Output
this is used if the flowchart needs input from the user or output from a
process.
3. Process
4. Decision
6. Off-page Connector
Pseudocode
Input
W,L
A = W x L
Print
A
End
Convert the length in feet to
centimeter
Algorithm
Step 1: Input Lft
Pseudocode
Input
Lft
Print
Lcm
End
Compute for the monthly paycheck of a salesperson at a
department store. The employee would receive a bonus
of Php 300.00 for each year if he/she has been with the
store for two years or less. If the employee has been with
the store for more than two years, the bonus is Php
500.00 for each year.
Algorithm
Step 1: Get the base salary
Step 3:
Calculate the bonus using the following formula:
• If(noofyearsofservice is less than or equal to two)
Bonus = 300 * noofyearsofservice
• Otherwise
Bonus = 500 * noofyearsofservice
Calculate the paycheck using the following equation:
• Paycheck = base salary + bonus
Pseudocode
Input
spy
Bonus = 300*spy
N
If (spy <=2) Bonus = 500*spy Paycheck = bs + b
Y Print
Paycheck
1
End