SlideShare a Scribd company logo
PLANNING TOOLS
Planning Tools
• ALGORITHMS
• FLOW CHARTS
• PSEUDO CODE
• DECISION TABLES
Pseudocode
• It Means:
• IMITATION or FALSE CODE
• It is an imitation of the computer instruction
• Using this programmer can concentrate on
developing logic without worrying about
syntax
• Easy to convert into programming language
Writing Pseudocode
Basic computer operations
There are six basic computer operations
1.computer can receive information
2.computer can put out information
3.computer can perform arithmetic
4.computer can assign a value to a variable or
memory location
5.computer can compare two variables and select
one of two alternate actions
6.computer can repeat a group of actions
5
Six Basic Computer Operations
1 A computer can receive information
– When a computer is required to receive
information or input from a particular source,
whether it is a terminal, a disk or any other
device, the verbs Read and Get are used in
pseudocode
Read => Input from a record
Get => Input from keyboard
Example pseudocode
1.Read student name
2.Get system data
3.Read number1, number2
4.Get tax_code
6
Six Basic Computer Operations
2 A computer can put out information
– When a computer is required to supply
information or output to a device, the verbs
Print, Write, Put, Output, or Display are used
in pseudocode
– Print => send output to printer
– Write => send out to file
– Put, Output, Display => send
to screen
Example pseudocode
1.Print ‘Program Completed’
2.Write customer record to master file
3.Output total tax
4.Display ‘End of data’
7
Six Basic Computer Operations
3 A computer can perform arithmetic
– Most programs require the computer to perform some sort of
mathematical calculation, or formula, and for these, a
programmer may use either actual mathematical symbols or the
words for those symbols
– To be consistent with high-level programming languages, the
following symbols can be written in pseudocode:
+ for Add - for Subtract
* for Multiply / for Divide ( ) for Parentheses
– When writing mathematical calculations for the computer,
standard mathematical ‘order of operations’ applies to
pseudocode and most computer languages
8
Six Basic Computer Operations
4 A computer can assign a value to a variable or
memory location
– There are three cases where you may write pseudocode
to assign a value to a variable or memory location:
1. To give data an initial value in pseudocode, the verbs
Initialize or Set are used
2. To assign a value as a result of some processing the symbols
‘=‘ or ‘←’ are written
3. To keep a variable for later use, the verbs Save or Store are
used
9
Six Basic Computer Operations
4 A computer can assign a value to a variable
or memory location
Example pseudocode
1.Initialize total_price to zero
2.Set student_count to zero
3.Total_price = cost_price + sales_tax
4.Total_price  cost_price + sales_tax
5.Store customer_num in last_customer_num
10
Six Basic Computer Operations
5 A computer can compare two variables and
select one or two alternate actions
– An important computer operation available to the
programmer is the ability to compare two
variables and then, as a result of the comparison,
select one of two alternate actions
– To represent this operation in pseudocode, special
keywords are used: IF and ELSE
The Selection Structure
amount < 100
interestRate = .06 interestRaate = .10
yes no
1. IF amount < 100
1.1 interestRate = .06
2. ELSE
2.1 Interest Rate = .10Pseudocode 
12
Six Basic Computer Operations
6 A computer can repeat a group of actions
– When there is a sequence of processing steps that need to be
repeated, a special keyword, WHILE is used in pseudocode
– The condition for the repetition of a group of actions is
established in the WHILE clause, and the actions to be
repeated are listed beneath it
Repetition using WHILE
Start
count = 0
count
<10
add 1 to
count
write count
Write
“The End”
Stop
1. count = 0
2. WHILE count < 10
2.1 ADD 1 to count
2.2 WRITE count
3. WRITE “The End”
Mainline
1.count = 0
2.DOWHILE count < 10
2.1 DO Process
3.WRITE “The End”
Process
2.1 ADD 1 to count
2.2 WRITE count
 Modular
Rules for Pseudocode
• Write only one statement per line
• Capitalize initial keyword
• Indent to show hierarchy
• End multiline structures
• Keep statements language
independent
One Statement Per Line
Each statement in pseudocode should
express just one action for the computer.
Pseudocode
READ name, hoursWorked, payRate
gross = hoursWorked * payRate
WRITE name, hoursWorked, gross
Capitalize Initial Keyword
In the example below note the words: READ and
WRITE. These are just a few of the keywords to use,
others include:
READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE
Pseudocode
READ name, hoursWorked, payRate
gross = hoursWorked * payRate
WRITE name, hoursWorked, gross
Rules for Variable Names
• Begin with lowercase letter
• Contain no spaces
• Additional words begin with capital
• Unique names within code
• Consistent use of names
Indent to Show Hierarchy
• Sequence:
Keep statements in sequence all starting in the same column
• Selection:
Indent statements that fall inside selection structure, but not the keywords that form
the selection
• Loop:
Indent statements that fall inside the loop but not keywords that form the loop
Each design structure uses a particular
indentation pattern
READ name, grossPay, taxes
IF taxes > 0
net = grossPay – taxes
ELSE
net = grossPay
ENDIF
WRITE name, net
End Multiline Structures
See the IF/ELSE/ENDIF as constructed
above, the ENDIF is in line with the IF.
The same applies for WHILE/ENDWHILE
etc…
READ name, grossPay, taxes
IF taxes > 0
net = grossPay – taxes
ELSE
net = grossPay
ENDIF
WRITE name, net
Types of Logic Structure
• Sequence
• Selection
• Iteration
Sequence
• Performing instruction one after another
The Selection Structure
amount < 100
interestRate = .06 interestRate = .10
yes no
IF amount < 100
interestRate = .06
ELSE
Interest Rate = .10
ENDIF
Pseudocode 
The Looping Structure
In flowcharting one of the more confusing
things is to separate selection from looping.
This is because each structure use the
diamond as their control symbol. In
pseudocode we avoid this by using specific
keywords to designate looping
WHILE/ENDWHILE
REPEAT/UNTIL
WHILE / ENDWHILE
Start
count = 0
count
<10
add 1 to
count
write count
Write
“The End”
Stop
count = 0
WHILE count < 10
ADD 1 to count
WRITE count
ENDWHILE
WRITE “The End”
Mainline
count = 0
WHILE count < 10
DO Process
ENDWHILE
WRITE “The End”
Process
ADD 1 to count
WRITE count
 Modular
REPEAT / UNTIL
Start
count = 0
count
<10
add 1 to
count
write count
Write
“The End”
Stop
count = 0
REPEAT
ADD 1 to count
WRITE count
UNTIL count >= 10
WRITE “The End”
Mainline
count = 0
REPEAT
DO Process
UNTIL count >= 10
WRITE “The End”
Process
ADD 1 to count
WRITE count
 Modular
Advantages & Disadvantages
Flowchart Advantages:
 Standardized
 Visual
Pseudocode Advantages
 Easily modified
 Implements structured
concepts
 Done easily on Word
Processor
Flowchart Disadvantages:
 Hard to modify
 Structured design elements not
implemented
 Special software required
 Time Consuming
Pseudocode Disadvantages:
 Not visual
 No accepted standard, varies from
company to company
Working with Fields
Calculations
+ add
- subtract
* multiply
/ divide
** or ^ exponentiation
( ) grouping
Selection
> greater than
< less than
= equal to
>= greater than or
equal to
<= less than or equal to
!= not equal to
Any Questions
pseudo code basics

More Related Content

PPTX
Introduction to Pseudocode
PPTX
What is an algorithm?
PPTX
Units and Measurement
PPTX
Educational Business Plan
PDF
Pseudocode & flowchart examples
PPTX
Flowchart and algorithm
PPT
Pqf and aqrf special man com_feb17
PPTX
Pseudocode
Introduction to Pseudocode
What is an algorithm?
Units and Measurement
Educational Business Plan
Pseudocode & flowchart examples
Flowchart and algorithm
Pqf and aqrf special man com_feb17
Pseudocode

What's hot (20)

PPTX
PPTX
Infix to postfix conversion
PPTX
Introduction to programming
PPTX
Pseudocode
PPT
Operators in C++
PDF
C++ OOPS Concept
PPT
Data structures using c
PPT
Expression evaluation
PPTX
Control statements in c
PPTX
Unit 6. Arrays
PPT
Functions in C++
PPT
Infix prefix postfix
PPTX
Constants, Variables, and Data Types
PPSX
Javascript variables and datatypes
PPTX
Type casting in c programming
PPTX
Function in C program
PDF
Expression trees
PPT
Data structure
PPTX
Linked list
Infix to postfix conversion
Introduction to programming
Pseudocode
Operators in C++
C++ OOPS Concept
Data structures using c
Expression evaluation
Control statements in c
Unit 6. Arrays
Functions in C++
Infix prefix postfix
Constants, Variables, and Data Types
Javascript variables and datatypes
Type casting in c programming
Function in C program
Expression trees
Data structure
Linked list
Ad

Similar to pseudo code basics (20)

PPT
Modul Mata Kuliah Desain Prodi Sistem InformasiAgoritma.ppt
PPTX
KMK1093 CHAPTER 2.kkkpptx KMK1093 CHAPTER 2.kkkpptx
PDF
4. programing 101
PPT
My programming final proj. (1)
PDF
PPSX
Complete C++ programming Language Course
PPT
3 algorithm-and-flowchart
PPTX
Macasu, gerrell c.
PPT
lec_4_data_structures_and_algorithm_analysis.ppt
PPT
lec_4_data_structures_and_algorithm_analysis.ppt
PPT
Code Tuning
PPTX
Switch case and looping new
PPT
Program logic and design
PDF
Python Training Course in Chandigarh(Mohali)
PDF
Python Training in Chandigarh(Mohali)
PPTX
Switch case and looping kim
PPTX
Lecture 1 Introduction C++
PPTX
UNIT 1.pptx
PPT
oracle pl-sql lec 7 oracle pl-sql lec 7 plsql Lec07.ppt
PPTX
My final requirement
Modul Mata Kuliah Desain Prodi Sistem InformasiAgoritma.ppt
KMK1093 CHAPTER 2.kkkpptx KMK1093 CHAPTER 2.kkkpptx
4. programing 101
My programming final proj. (1)
Complete C++ programming Language Course
3 algorithm-and-flowchart
Macasu, gerrell c.
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
Code Tuning
Switch case and looping new
Program logic and design
Python Training Course in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)
Switch case and looping kim
Lecture 1 Introduction C++
UNIT 1.pptx
oracle pl-sql lec 7 oracle pl-sql lec 7 plsql Lec07.ppt
My final requirement
Ad

More from Sabik T S (7)

PPT
Managers roles and skills
PPTX
Introduction to C programming
PPT
Algorithm and Flowcharts
PPTX
Data Input and Output
PPT
decision table training session
DOC
cover letter
PDF
Types of welding
Managers roles and skills
Introduction to C programming
Algorithm and Flowcharts
Data Input and Output
decision table training session
cover letter
Types of welding

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
PPTX
master seminar digital applications in india
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Lesson notes of climatology university.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPH.pptx obstetrics and gynecology in nursing
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Sports Quiz easy sports quiz sports quiz
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pre independence Education in Inndia.pdf
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
master seminar digital applications in india
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Basic Mud Logging Guide for educational purpose
Lesson notes of climatology university.

pseudo code basics

  • 2. Planning Tools • ALGORITHMS • FLOW CHARTS • PSEUDO CODE • DECISION TABLES
  • 3. Pseudocode • It Means: • IMITATION or FALSE CODE • It is an imitation of the computer instruction • Using this programmer can concentrate on developing logic without worrying about syntax • Easy to convert into programming language
  • 4. Writing Pseudocode Basic computer operations There are six basic computer operations 1.computer can receive information 2.computer can put out information 3.computer can perform arithmetic 4.computer can assign a value to a variable or memory location 5.computer can compare two variables and select one of two alternate actions 6.computer can repeat a group of actions
  • 5. 5 Six Basic Computer Operations 1 A computer can receive information – When a computer is required to receive information or input from a particular source, whether it is a terminal, a disk or any other device, the verbs Read and Get are used in pseudocode Read => Input from a record Get => Input from keyboard Example pseudocode 1.Read student name 2.Get system data 3.Read number1, number2 4.Get tax_code
  • 6. 6 Six Basic Computer Operations 2 A computer can put out information – When a computer is required to supply information or output to a device, the verbs Print, Write, Put, Output, or Display are used in pseudocode – Print => send output to printer – Write => send out to file – Put, Output, Display => send to screen Example pseudocode 1.Print ‘Program Completed’ 2.Write customer record to master file 3.Output total tax 4.Display ‘End of data’
  • 7. 7 Six Basic Computer Operations 3 A computer can perform arithmetic – Most programs require the computer to perform some sort of mathematical calculation, or formula, and for these, a programmer may use either actual mathematical symbols or the words for those symbols – To be consistent with high-level programming languages, the following symbols can be written in pseudocode: + for Add - for Subtract * for Multiply / for Divide ( ) for Parentheses – When writing mathematical calculations for the computer, standard mathematical ‘order of operations’ applies to pseudocode and most computer languages
  • 8. 8 Six Basic Computer Operations 4 A computer can assign a value to a variable or memory location – There are three cases where you may write pseudocode to assign a value to a variable or memory location: 1. To give data an initial value in pseudocode, the verbs Initialize or Set are used 2. To assign a value as a result of some processing the symbols ‘=‘ or ‘←’ are written 3. To keep a variable for later use, the verbs Save or Store are used
  • 9. 9 Six Basic Computer Operations 4 A computer can assign a value to a variable or memory location Example pseudocode 1.Initialize total_price to zero 2.Set student_count to zero 3.Total_price = cost_price + sales_tax 4.Total_price  cost_price + sales_tax 5.Store customer_num in last_customer_num
  • 10. 10 Six Basic Computer Operations 5 A computer can compare two variables and select one or two alternate actions – An important computer operation available to the programmer is the ability to compare two variables and then, as a result of the comparison, select one of two alternate actions – To represent this operation in pseudocode, special keywords are used: IF and ELSE
  • 11. The Selection Structure amount < 100 interestRate = .06 interestRaate = .10 yes no 1. IF amount < 100 1.1 interestRate = .06 2. ELSE 2.1 Interest Rate = .10Pseudocode 
  • 12. 12 Six Basic Computer Operations 6 A computer can repeat a group of actions – When there is a sequence of processing steps that need to be repeated, a special keyword, WHILE is used in pseudocode – The condition for the repetition of a group of actions is established in the WHILE clause, and the actions to be repeated are listed beneath it
  • 13. Repetition using WHILE Start count = 0 count <10 add 1 to count write count Write “The End” Stop 1. count = 0 2. WHILE count < 10 2.1 ADD 1 to count 2.2 WRITE count 3. WRITE “The End” Mainline 1.count = 0 2.DOWHILE count < 10 2.1 DO Process 3.WRITE “The End” Process 2.1 ADD 1 to count 2.2 WRITE count  Modular
  • 14. Rules for Pseudocode • Write only one statement per line • Capitalize initial keyword • Indent to show hierarchy • End multiline structures • Keep statements language independent
  • 15. One Statement Per Line Each statement in pseudocode should express just one action for the computer. Pseudocode READ name, hoursWorked, payRate gross = hoursWorked * payRate WRITE name, hoursWorked, gross
  • 16. Capitalize Initial Keyword In the example below note the words: READ and WRITE. These are just a few of the keywords to use, others include: READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE Pseudocode READ name, hoursWorked, payRate gross = hoursWorked * payRate WRITE name, hoursWorked, gross
  • 17. Rules for Variable Names • Begin with lowercase letter • Contain no spaces • Additional words begin with capital • Unique names within code • Consistent use of names
  • 18. Indent to Show Hierarchy • Sequence: Keep statements in sequence all starting in the same column • Selection: Indent statements that fall inside selection structure, but not the keywords that form the selection • Loop: Indent statements that fall inside the loop but not keywords that form the loop Each design structure uses a particular indentation pattern READ name, grossPay, taxes IF taxes > 0 net = grossPay – taxes ELSE net = grossPay ENDIF WRITE name, net
  • 19. End Multiline Structures See the IF/ELSE/ENDIF as constructed above, the ENDIF is in line with the IF. The same applies for WHILE/ENDWHILE etc… READ name, grossPay, taxes IF taxes > 0 net = grossPay – taxes ELSE net = grossPay ENDIF WRITE name, net
  • 20. Types of Logic Structure • Sequence • Selection • Iteration
  • 22. The Selection Structure amount < 100 interestRate = .06 interestRate = .10 yes no IF amount < 100 interestRate = .06 ELSE Interest Rate = .10 ENDIF Pseudocode 
  • 23. The Looping Structure In flowcharting one of the more confusing things is to separate selection from looping. This is because each structure use the diamond as their control symbol. In pseudocode we avoid this by using specific keywords to designate looping WHILE/ENDWHILE REPEAT/UNTIL
  • 24. WHILE / ENDWHILE Start count = 0 count <10 add 1 to count write count Write “The End” Stop count = 0 WHILE count < 10 ADD 1 to count WRITE count ENDWHILE WRITE “The End” Mainline count = 0 WHILE count < 10 DO Process ENDWHILE WRITE “The End” Process ADD 1 to count WRITE count  Modular
  • 25. REPEAT / UNTIL Start count = 0 count <10 add 1 to count write count Write “The End” Stop count = 0 REPEAT ADD 1 to count WRITE count UNTIL count >= 10 WRITE “The End” Mainline count = 0 REPEAT DO Process UNTIL count >= 10 WRITE “The End” Process ADD 1 to count WRITE count  Modular
  • 26. Advantages & Disadvantages Flowchart Advantages:  Standardized  Visual Pseudocode Advantages  Easily modified  Implements structured concepts  Done easily on Word Processor Flowchart Disadvantages:  Hard to modify  Structured design elements not implemented  Special software required  Time Consuming Pseudocode Disadvantages:  Not visual  No accepted standard, varies from company to company
  • 27. Working with Fields Calculations + add - subtract * multiply / divide ** or ^ exponentiation ( ) grouping Selection > greater than < less than = equal to >= greater than or equal to <= less than or equal to != not equal to