SlideShare ist ein Scribd-Unternehmen logo
1 von 29
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

Weitere ähnliche Inhalte

Was ist angesagt?

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2Self-Employed
 
Array data structure
Array data structureArray data structure
Array data structuremaamir farooq
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structureAbrish06
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTUREArchie Jamwal
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Applications of stack
Applications of stackApplications of stack
Applications of stackeShikshak
 
Time space trade off
Time space trade offTime space trade off
Time space trade offanisha talwar
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C LanguageAryan Ajmer
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchartfika sweety
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming LanguageAhmad Idrees
 

Was ist angesagt? (20)

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Stack
StackStack
Stack
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Array data structure
Array data structureArray data structure
Array data structure
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Stacks
StacksStacks
Stacks
 
Algorithm and psuedocode
Algorithm and psuedocodeAlgorithm and psuedocode
Algorithm and psuedocode
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Data structure Stack
Data structure StackData structure Stack
Data structure Stack
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Time space trade off
Time space trade offTime space trade off
Time space trade off
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Control structures in C++ Programming Language
Control structures in C++ Programming LanguageControl structures in C++ Programming Language
Control structures in C++ Programming Language
 

Ähnlich wie pseudo code basics

4. programing 101
4. programing 1014. programing 101
4. programing 101IEEE MIU SB
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)aeden_brines
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language CourseVivek chan
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptSourabhPal46
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptMard Geer
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping newaprilyyy
 
Program logic and design
Program logic and designProgram logic and design
Program logic and designChaffey College
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)ExcellenceAcadmy
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)ExcellenceAcadmy
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kimkimberly_Bm10203
 
Lecture 1 Introduction C++
Lecture 1 Introduction C++Lecture 1 Introduction C++
Lecture 1 Introduction C++Ajay Khatri
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptxmiansaad18
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review ProcessDr. Syed Hassan Amin
 

Ähnlich wie pseudo code basics (20)

4. programing 101
4. programing 1014. programing 101
4. programing 101
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
 
pm1
pm1pm1
pm1
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
Code Tuning
Code TuningCode Tuning
Code Tuning
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)
 
Switch case and looping kim
Switch case and looping kimSwitch case and looping kim
Switch case and looping kim
 
Lecture 1 Introduction C++
Lecture 1 Introduction C++Lecture 1 Introduction C++
Lecture 1 Introduction C++
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
My final requirement
My final requirementMy final requirement
My final requirement
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 

Mehr von Sabik T S

Managers roles and skills
Managers roles and skillsManagers roles and skills
Managers roles and skillsSabik T S
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingSabik T S
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSabik T S
 
Data Input and Output
Data Input and OutputData Input and Output
Data Input and OutputSabik T S
 
decision table training session
decision table training sessiondecision table training session
decision table training sessionSabik T S
 
cover letter
cover lettercover letter
cover letterSabik T S
 
Types of welding
Types of welding Types of welding
Types of welding Sabik T S
 

Mehr von Sabik T S (7)

Managers roles and skills
Managers roles and skillsManagers roles and skills
Managers roles and skills
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Data Input and Output
Data Input and OutputData Input and Output
Data Input and Output
 
decision table training session
decision table training sessiondecision table training session
decision table training session
 
cover letter
cover lettercover letter
cover letter
 
Types of welding
Types of welding Types of welding
Types of welding
 

Kürzlich hochgeladen

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

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