0% found this document useful (0 votes)
267 views

Writing An Algorithm, Pseudocode, and Flowchart

The document discusses writing algorithms, pseudocode, and flowcharts to solve programming problems. It provides examples of how to write pseudocode, draw flowcharts, and write step-by-step algorithms to solve sample problems involving converting between units, calculating averages, percentages, and ratios. The key steps are to identify the problem, analyze it, develop an algorithm using pseudocode, then represent the logic using a flowchart and programming code.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
267 views

Writing An Algorithm, Pseudocode, and Flowchart

The document discusses writing algorithms, pseudocode, and flowcharts to solve programming problems. It provides examples of how to write pseudocode, draw flowcharts, and write step-by-step algorithms to solve sample problems involving converting between units, calculating averages, percentages, and ratios. The key steps are to identify the problem, analyze it, develop an algorithm using pseudocode, then represent the logic using a flowchart and programming code.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

WRITING AN ALGORITHM,

PSEUDOCODE, AND
FLOWCHART
SOLVING PROGRAMMING PROBLEMS

Programming
• A process of problem
solving.

Source Code
• Human instructions for the
computer
PROCESS IN SOLVING PROGRAMMING
LANGUAGE
Problem • Identify the problem

Analysis
• Analyze the problem to identify
possible solutions.

Algorithm • To itemize the possible step-by-step


instructions
• Process of source codes entered through
Coding a programming language
• The instructions will be translated with the help of Library.

Compiler • Library – collection of resources or routines used by computer


programs
• (No syntax error) It will
Linker process the code for execution

• It will lead the codes for the


Execution desired output.

Output •Result
WHAT IS A FLOWCHART?

•A diagram representing the logical


sequence with combination of steps
or operations to performed.
BASIC SYMBOL USED IN
FLOWCHARTING
BASIC SYMBOL USED IN FLOWCHARTING

• TERMINATOR
Beginning and the end of
the flowchart (“Start” and
“End”)
BASIC SYMBOL USED IN FLOWCHARTING

• INPUT/OUTPUT
Used if the flowchart needs
input from the user or output
from the process
BASIC SYMBOL USED IN FLOWCHARTING

• PROCESS
Used to process data
Normally composed of
mathematical symbols
BASIC SYMBOL USED IN FLOWCHARTING

• ARROWS
Shows the flow of the
Process
DRAWING A FLOWCHART

START

Input Lft

Lcm = Lft * 30.48

Print Lft
WHAT IS A PSEUDOCODE?

• Description of an algorithm using a natural


language that makes reading program
easier.
• Uses short English statements to write
codes for programs.
WHAT IS AN ALGORITHM?

• STEP-BY-STEP procedure to solve


problems.
• It helps to identify processes and special
variables to solve the problem.
WRITING A PSEUDOCODE

•Input the length in feet (Lft)


•Calculate the length in (Lcm) by
multiplying Lft with 30.48
•Print Length in cm (Lcm)
WRITING AN ALGORITHM

Step 1: Input Lft


Step 2: Lcm = Lft x 30.48
Step 3: Print Lcm
DRAWING A FLOWCHART

START

Input Lft

Lcm = Lft * 30.48

Print Lft

END
WRITING THE PSEUDOCODE

•Input the three numbers (a), (b),


and (c).
•Compute for the Average (A) by
adding number (a), (b) and (c) and
divide the sum to three.
WRITING THE PSEUDOCODE

•Display Average (A)


WRITING AN ALGORITHM

•Step 1: Input a, b, c
•Step 2: A = a+b+c/3
•Step 3: Display A
DRAWING A FLOWCHART

START

Input a, b, c

A = a+b+c/3

Display A

END
WRITING THE PSEUDOCODE

•Input the base (b)


•Input the percentage (p)
•Convert the percentage (p) to decimal
(d) by dividing (p) by 100
•Multiply base (b) by decimal (d)
WRITING AN ALGORITHM

•Step 1:
•Step 2:
•Step 3:
•Step 4:
WRITING THE PSEUDOCODE

•Input the number of girls (g)


•Input the number of boys (b)
•Input a colon (:) between the number of
boys and girls.
•Display the ratio of the class (C)
WRITING AN ALGORITHM

•Step 1:
•Step 2:
•Step 3:
•Step 4:

You might also like