You are on page 1of 19

PSEUDOCODE

MARIA CRISTINA A. MAGON


(INSTRUCTOR)
Technical Terms
Pseudocode- use to describe
processes using natural language

Syntax- set of rules that defines


the combinations of symbols that
are considered to be correctly
structured document or fragment
in that language
Technical Terms
Task- a basic unit of programming
that an operating system control.
Depending on how the operating
system defines a task in its design,
this unit on programming may be
an entire program or each
successive invocation of a program
Technical Terms
Variable- is a value that can
change, depending on the
conditions or on information
passed to the program. Typically, a
program consists of instructions
that tell the computer what to do
and data that the program uses
when it is running.
Pseudocode
 is a description of an algorithm or a
computer program using natural language.
 The aim of pseudocode is to make reading

program easier, some codes that are


essential for human understanding are
omitted.
 A simple way of writing programming code

in English
 It is not actual programming language
Pseudocode
 It uses short phrases to write code for
programs before you actually create it in a
specific language.
 Pseudocode makes creating programs

easier.
 To use pseudocode, all you do is write what

you want your program to say in English


 Allows you to translate your statements

into any language because there are no


special commands and it is not
standardized.
Pseudocode:
Remember, writing basic
pseudocode is not like writing an
actual coding language. It can be
compiled or run like a regular
program.
Pseudocode can be written how
you want.
Pseudocode:
Syntax- a set of rules on how to
use and organize statements in a
programming language.
Advantages of Pseudocode:

 reduced complexity
 increased flexibility
 ease of understanding
PRACTICING PSEUDOCODE

Step 1: Choose a Task


 Choose a simple task to

accomplish with your program


PRACTICING PSEUDOCODE

Step 2: Write the Pseudocode


 When writing the code, remember

the following guide-lines:


 The language should be universal
 Limit each line to one task/ action
 Capitalized all key words (even if not
at the beginning of a sentence)
PRACTICING PSEUDOCODE

 Indent loops (like if/then


statements)
 Don’t forget to start with “Start
Program” and end with “End
Program”
PRACTICING PSEUDOCODE

3. Test your code


 After you have written your
pseudocode program, put it aside
for at least 1 day
 When you are ready, try to follow

your program exactly


PRACTICING PSEUDOCODE

3. Test your code


 If you needed to do any trouble
shooting, wait another day or two
before testing your code again.
 Alternatively, you can ask someone
to attempt to complete your task
following your pseudocode precisely.
Why is Pseudocode Necessary?

 The programming process is a


complicated one.
 You must first understand the
program specifications.
 Then you need to organize your
thoughts and create the program.
Why is Pseudocode Necessary?

 You must break the main tasks that


must be accomplished into smaller
ones in order to be able to eventually
write fully developed code.
 Writing Pseudocode will save you time
later during the construction & testing
phase of a program's development.
Example
(Algorithm for Classifying Student’s Grade)

If student’s grade is greater than or equal to 75


Print “Passed”
else
Print “Failed”

The example above is an algorithm of


determining whether a student with a specific
mark should passed or failed. With the help of
pseudocode, one can easily understand it
without having to know the technicalities.
Examples of Pseudocode:
1. Create a program to add 2 numbers
together and then display the result
 Start program
 Enter two number, A, B
 Add the numbers together
 Print Sum
 End program
Examples of Pseudocode:
2. Compute the area of a rectangle
 Get the length, l, and width, w
 Compute the area= l*w
 Display the area

You might also like