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

Computer Programming 1: Using Pseudocode and Flowcharts

The document discusses using pseudocode and flowcharts to plan the logic for computer programs. Pseudocode uses an English-like representation while flowcharts use graphic symbols and arrows to show program logic and flow. Examples are given of pseudocode and a flowchart that doubles a number, illustrating how they represent the same logic in different formats.

Uploaded by

Milca DG Quinto
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Computer Programming 1: Using Pseudocode and Flowcharts

The document discusses using pseudocode and flowcharts to plan the logic for computer programs. Pseudocode uses an English-like representation while flowcharts use graphic symbols and arrows to show program logic and flow. Examples are given of pseudocode and a flowchart that doubles a number, illustrating how they represent the same logic in different formats.

Uploaded by

Milca DG Quinto
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Computer Programming

1
USING PSEUDOCODE AND
FLOWCHARTS
When programmers plan the logic for a solution to a programming
problem, they often use one two tools “ pseudocode” or flowchart.

Pseudocode – is an English-like representation of the logical steps it


takes to solve a problem.

Flowchart – is a pictorial representation of the same thing.


Writing Pseudocode

The following five statements constitute a pseudocode


representation of a number-doubling problem:
start
input myNumber
myAnswer = myNumber *2
output myAnswer
stop

using pseudocode involves writing down all the steps you will use in program. Usually, programmers
preface their pseudocode with a beginning statement like start and end it with a terminating statement
like stop.
Drawing Flowcharts
When you create flowchart, you draw geometric shapes that contain the individual
statements and that are connected with arrows. Common flowchart symbols include:

input/ output symbols – represented by parallelogram, indicating input and


or output operations.

processing symbols – represented by rectangles, indicating processing


steps, such as arithmetic statements.

terminal symbols – represented by lozenges (oval with flattened tops) that


mark the beginning and end of a sequence of steps.
decision symbol – represented by diamonds. Decision symbols hold
questions that allow program logic to follow divergent paths.

To show the correct sequence of these symbols for the logic you are developing, you use
arrows, or flowlines, to connect the steps. Whenever possible, most of a flowchart should
read from top to bottom or from left to right on a page
The figure shows a complete flowchart for the program that doubles a
number, and the pseudocode for the same problem. You can see from
the figure that the flowchart and pseudocode statements are the same –
only the presentation format differs.
Exercises:

1. Two numbers as input and displays the product of the numbers.


2. Using pseudocode and a flowchart, develop the logic for a program that
accepts a number as input and displays the number five times.

You might also like