0% found this document useful (0 votes)
54 views6 pages

2 Flowchart and Pseudocode

The document explains the basics of flowcharts and pseudocode, including the shapes used in flowcharts to represent different program components and the rules for writing pseudocode. It provides examples of flowcharts for various tasks such as summing numbers and checking if a number is even or odd. Additionally, it outlines the construction of pseudocode for algorithm description using natural language and programming elements.

Uploaded by

easdeathsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views6 pages

2 Flowchart and Pseudocode

The document explains the basics of flowcharts and pseudocode, including the shapes used in flowcharts to represent different program components and the rules for writing pseudocode. It provides examples of flowcharts for various tasks such as summing numbers and checking if a number is even or odd. Additionally, it outlines the construction of pseudocode for algorithm description using natural language and programming elements.

Uploaded by

easdeathsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

(2) Flowchart and Pseudocode

Flowchart

Flowcharts are written with program flow from top to bottom of a page.
Each command is placed in an appropriate-shaped box, and arrows are utilized to
control program progress.
Here are the different shapes used in creating a flowchart:

Oval - An oval indicates beginning or end of the program.


Parallelogram - A parallelogram is point where there is input to our output from
the program.
Rectangle - A rectangle indicates the assignment of the value to a variable,
constant, or parameter. The assigned value can be the result of the computation.
The computation would also be included in the rectangle.
Diamond - A diamond indicates a point where a decision is made.
Circle - Circles can be used to combine flow lines.
Arrows - Arrows indicate the direction and order of program execution.

Examples:
1. Create a flowchart to get the sum of 2 numbers.

2. Create a flowchart to determine if a number is even or odd.


3. Create a flowchart to display 1 to 5.

4. Create a flowchart to display 1 to n, where n is a user input.

5. Create a flowchart to check and display if a number entered by the user is greater than,
less than, or equal to 5.
Pseudocode

Pseudocode is a method for describing computer algorithms that combines natural


language with programming.
Rules in constructing pseudocode:
1. Arithmetic operations are represented by the standard symbols(+, -, *, /, **)
2. Keywords like PRINT, WRITE, READ, and others can be utilized.
3. Indentation should be used to indicate instruction loops and branches.

Examples:
1. Write a pseudocode for identifying if a number is even or odd.

2. Write a pseudocode for adding numbers from 1 to 5 (1+2+3+4+5)


3. Write a pseudocode for displaying "hello" n-times

4. Write a pseudocode that adds two numbers entered by the user.

You might also like