SlideShare a Scribd company logo
1 of 17
Pseudocode
 An Introduction




    Name Kiranjot Kaur
    Branch- CSE
    Section- N1
    Roll no- 115330
Flowcharts were the firs t des ign tool to
be widely us ed, but unfortunately they do
not reflect s ome of the c oncepts of
s tructured programming very well.
Ps eudocode, on the other hand, is a
newer tool and has features that make it
more reflective of the s truc tured
concepts . The drawback is that the
narrative pres entation is not as eas y to
unders tand and/or follow.
Rules for Ps eudocode

• Write only one s tatement per line
• C apitalize initial keyword
• Indent to s how hierarc hy
• E nd multiline s tructures
• Keep s tatements language
  independent
One S tatement Per Line
E ach s tatement in ps eudocode s hould
expres s jus t one action for the computer.
If the tas k lis t is properly drawn, then in
mos t cas es each tas k will corres pond to
one line of ps eudocode.
               Task List                                Pseudocode
Read name, hours worked, rate of pay       READ name, hoursWorked, payRate
Perform calculations                       gross = hoursWorked * payRate
      gross = hours worked * rate of pay   WRITE name, hoursWorked, gross
Write name, hours worked, gross
C apitalize Initial Keyword
In the example below note the words : RE A D and
WRITE . Thes e are jus t a few of the keywords to
us e, others include:

    RE A D, WRITE , IF, E LS E , E NDIF, WHILE , E NDWHILE



                     Pseudocode
           READ name, hoursWorked, payRate
           gross = hoursWorked * payRate
           WRITE name, hoursWorked, gross
Indent to S how Hierarchy
     E ch design stuct e uses apat a indent t pat n
      a           r ur           ricul r  aion ter

 •     S equence:
        Keep s tatements in s equence all s tarting in the s ame column

 •    S election:
       Indent s tatements that fall ins ide s election s tructure, but not the keywords that
          form the s election

 •     Loop:
        Indent s tatements that fall ins ide the loop but not keywords that form the loop
          READ name, grossPay, taxes
          IF taxes > 0
                 net = grossPay – taxes
          ELSE
                 net = grossPay
          ENDIF
          WRITE name, net
E nd Multiline S tructures
   READ name, grossPay, taxes
   IF taxes > 0
       net = grossPay – taxes
   ELSE
       net = grossPay
   ENDIF
   WRITE name, net

S ee the IF/E LS E /E NDIF as cons tructed
above, the E NDIF is in line with the IF.

The s ame applies for WHILE /E NDWHILE
 etc…
Language Independence
Res is t the urge to write in whatever language you
are mos t comfortable with, in the long run you
will s ave time. Remember you are des cribing a
logic plan to develop a program, you are not
programming!
T Sel ion St uct e
                    he ect r ur

                    yes                           no
                               amount < 100




       interestRate = .06                          interestRate = .10




                     IF amount < 100
                            interestRate = .06

Pseudocode          ELSE
                            Interest Rate = .10
                     ENDIF
T L
            he oopingSt uct e
                      r ur

In flowcharting one of the more confus ing
things is to s eparate s election from
looping. This is becaus e each s tructure
us e the diamond as their control s ymbol.
In ps eudocode we avoid this by us ing
s pecific keywords to des ignate looping
      WHILE /E NDWHILE
      RE PE A T/UNTIL
W E/E HIL
                        HIL NDW E
   Start
                           count = 0
                           WHILE count < 10
                               ADD 1 to count
 count = 0
                               WRITE count
                           ENDWHILE
                           WRITE “The End”
   count
                           Mainline
    <10
                                                 Modular
                           count = 0
                Write
              “The End”
                           WHILE count < 10
   add 1 to
    count                      DO Process
                           ENDWHILE
                Stop
write count                WRITE “The End”

                           Process
                           ADD 1 to count
                           WRITE count
R PE T/UNT
                E A      IL
   Start           count = 0
                   REPEAT
 count = 0
                       ADD 1 to count
                       WRITE count
                   UNTIL count >= 10
   add 1 to        WRITE “The End”
    count

                   Mainline
                                         Modular
 write count       count = 0
                   REPEAT
                       DO Process
   count
    <10            UNTIL count >= 10
                   WRITE “The End”
  Write            Process
“The End”
                   ADD 1 to count
  Stop             WRITE count
A a a &Disa a a
                  dv nt ges dv nt ges
Flowchart Advantages:                Pseudocode Advantages
    Standardized                       Easily modified
    Visual                             Implements structured
                                         concepts
                                        Done easily on Word
                                         Processor


Flowchart Disadvantages: Pseudocode Disadvantages:
   Hard to modify                      Not visual
   Structured design elements not      No accepted standard, varies from
    implemented                          company to company
   Special software required
A ofDaa
                        ccess t
T R A st t
 he E D aementt l t comput t getav l fr a inputdev a st e itin a
               els he    er o     aue om n        ice nd or
memor l t
     y ocaion.

                   Howt dea w h memor l t
                      o l it         y ocaions?


 Memory locations are identified by their addresses, we
 give them names (field names / variable names) using
 words descriptive to us such as ctr as opposed to a
 location addresses such as 19087.
Rules for Variable Names

•   Begin with lowercase letter
•   Contain no spaces
•   Additional words begin with capital
•   Unique names within code
•   Consistent use of names
Working with Fields
          Calculations           Selection
+         add              >    greater than
-         subtract         <    less than
*         multiply         =    equal to
/         divide           >=   greater than or equal to
** or ^   exponentiation   <=   less than or equal to
()        grouping         <>   not equal to
THANKS YOU

More Related Content

What's hot

Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case StatementsDipesh Pandey
 
10. switch case
10. switch case10. switch case
10. switch caseWay2itech
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C LanguageAryan Ajmer
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Control Structures
Control StructuresControl Structures
Control StructuresGhaffar Khan
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?Angela DeHart
 
PyCon 2015 (Py.15): Python Beginner's Tutorial
PyCon 2015 (Py.15): Python Beginner's TutorialPyCon 2015 (Py.15): Python Beginner's Tutorial
PyCon 2015 (Py.15): Python Beginner's TutorialDamian T. Gordon
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programmingprogramming9
 
Nand and nor as a universal gates
Nand and nor as a universal gatesNand and nor as a universal gates
Nand and nor as a universal gatesKaushal Shah
 
Pseudocode & flowchart examples
Pseudocode & flowchart examplesPseudocode & flowchart examples
Pseudocode & flowchart exampleshayrikk
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysissumitbardhan
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in pythonRaginiJain21
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction Sarmad Ali
 

What's hot (20)

Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case Statements
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
10. switch case
10. switch case10. switch case
10. switch case
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 
Modular programming
Modular programmingModular programming
Modular programming
 
Forloop
ForloopForloop
Forloop
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Control Structures
Control StructuresControl Structures
Control Structures
 
Boolean+logic
Boolean+logicBoolean+logic
Boolean+logic
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
 
PyCon 2015 (Py.15): Python Beginner's Tutorial
PyCon 2015 (Py.15): Python Beginner's TutorialPyCon 2015 (Py.15): Python Beginner's Tutorial
PyCon 2015 (Py.15): Python Beginner's Tutorial
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Nand and nor as a universal gates
Nand and nor as a universal gatesNand and nor as a universal gates
Nand and nor as a universal gates
 
Pseudocode & flowchart examples
Pseudocode & flowchart examplesPseudocode & flowchart examples
Pseudocode & flowchart examples
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction
 

Viewers also liked

Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examplesGautam Roy
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocodeAsha Sari
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsYash Gupta
 
Basic concepts
Basic conceptsBasic concepts
Basic conceptsHuma Ayub
 
Pseudocode
PseudocodePseudocode
PseudocodeGuy09
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmramannoval riansyah
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchartfika sweety
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeGeorgius Rinaldo
 
Computer programs, flow chart & algorithm
Computer programs, flow chart & algorithmComputer programs, flow chart & algorithm
Computer programs, flow chart & algorithmsamina khan
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Nabil Muhammad Firdaus
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchartArif Rahman
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode Damian T. Gordon
 
Presentation on generation of languages
Presentation on generation of languagesPresentation on generation of languages
Presentation on generation of languagesRicha Pant
 

Viewers also liked (20)

Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
 
Basic concepts
Basic conceptsBasic concepts
Basic concepts
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmraman
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - Pseudocode
 
Computer programs, flow chart & algorithm
Computer programs, flow chart & algorithmComputer programs, flow chart & algorithm
Computer programs, flow chart & algorithm
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
03 pseudocode
03 pseudocode03 pseudocode
03 pseudocode
 
Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchart
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode
 
Presentation on generation of languages
Presentation on generation of languagesPresentation on generation of languages
Presentation on generation of languages
 

Similar to An Introduction to Pseudocode

CMSC 131 Discussion 09-07-2011
CMSC 131 Discussion  09-07-2011CMSC 131 Discussion  09-07-2011
CMSC 131 Discussion 09-07-2011daslerpc
 
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
 
Lotusphere 2007 AD505 DevBlast 30 LotusScript Tips
Lotusphere 2007 AD505 DevBlast 30 LotusScript TipsLotusphere 2007 AD505 DevBlast 30 LotusScript Tips
Lotusphere 2007 AD505 DevBlast 30 LotusScript TipsBill Buchan
 
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014Stephen Boyd
 
PLI Presentation for Mainframe Programmers
PLI Presentation for Mainframe ProgrammersPLI Presentation for Mainframe Programmers
PLI Presentation for Mainframe ProgrammersSrinimf-Slides
 
What every beginning developer should know
What every beginning developer should knowWhat every beginning developer should know
What every beginning developer should knowAndy Lester
 
Вредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей КалинецВредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей КалинецSigma Software
 
Creating your own Abstract Processor
Creating your own Abstract ProcessorCreating your own Abstract Processor
Creating your own Abstract ProcessorAodrulez
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1Ilivecoding.tv
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxSONU KUMAR
 
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tipsBill Buchan
 
The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181Mahmoud Samir Fayed
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overviewElad Avneri
 

Similar to An Introduction to Pseudocode (20)

Algorithms
AlgorithmsAlgorithms
Algorithms
 
CMSC 131 Discussion 09-07-2011
CMSC 131 Discussion  09-07-2011CMSC 131 Discussion  09-07-2011
CMSC 131 Discussion 09-07-2011
 
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
 
Programming
ProgrammingProgramming
Programming
 
Lotusphere 2007 AD505 DevBlast 30 LotusScript Tips
Lotusphere 2007 AD505 DevBlast 30 LotusScript TipsLotusphere 2007 AD505 DevBlast 30 LotusScript Tips
Lotusphere 2007 AD505 DevBlast 30 LotusScript Tips
 
Database design guide
Database design guideDatabase design guide
Database design guide
 
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014Processing Workshop Slides for Ladies Learning Code - March 22, 2014
Processing Workshop Slides for Ladies Learning Code - March 22, 2014
 
Perfect Code
Perfect CodePerfect Code
Perfect Code
 
PLI Presentation for Mainframe Programmers
PLI Presentation for Mainframe ProgrammersPLI Presentation for Mainframe Programmers
PLI Presentation for Mainframe Programmers
 
What every beginning developer should know
What every beginning developer should knowWhat every beginning developer should know
What every beginning developer should know
 
Simple is the best
Simple is the bestSimple is the best
Simple is the best
 
Вредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей КалинецВредные советы .NET разработчикам, Сергей Калинец
Вредные советы .NET разработчикам, Сергей Калинец
 
Creating your own Abstract Processor
Creating your own Abstract ProcessorCreating your own Abstract Processor
Creating your own Abstract Processor
 
programming.ppt
programming.pptprogramming.ppt
programming.ppt
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
The View - The top 30 Development tips
The View - The top 30 Development tipsThe View - The top 30 Development tips
The View - The top 30 Development tips
 
The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overview
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

An Introduction to Pseudocode

  • 1. Pseudocode An Introduction Name Kiranjot Kaur Branch- CSE Section- N1 Roll no- 115330
  • 2. Flowcharts were the firs t des ign tool to be widely us ed, but unfortunately they do not reflect s ome of the c oncepts of s tructured programming very well. Ps eudocode, on the other hand, is a newer tool and has features that make it more reflective of the s truc tured concepts . The drawback is that the narrative pres entation is not as eas y to unders tand and/or follow.
  • 3. Rules for Ps eudocode • Write only one s tatement per line • C apitalize initial keyword • Indent to s how hierarc hy • E nd multiline s tructures • Keep s tatements language independent
  • 4. One S tatement Per Line E ach s tatement in ps eudocode s hould expres s jus t one action for the computer. If the tas k lis t is properly drawn, then in mos t cas es each tas k will corres pond to one line of ps eudocode. Task List Pseudocode Read name, hours worked, rate of pay READ name, hoursWorked, payRate Perform calculations gross = hoursWorked * payRate gross = hours worked * rate of pay WRITE name, hoursWorked, gross Write name, hours worked, gross
  • 5. C apitalize Initial Keyword In the example below note the words : RE A D and WRITE . Thes e are jus t a few of the keywords to us e, others include: RE A D, WRITE , IF, E LS E , E NDIF, WHILE , E NDWHILE Pseudocode READ name, hoursWorked, payRate gross = hoursWorked * payRate WRITE name, hoursWorked, gross
  • 6. Indent to S how Hierarchy E ch design stuct e uses apat a indent t pat n a r ur ricul r aion ter • S equence: Keep s tatements in s equence all s tarting in the s ame column • S election: Indent s tatements that fall ins ide s election s tructure, but not the keywords that form the s election • Loop: Indent s tatements that fall ins ide the loop but not keywords that form the loop READ name, grossPay, taxes IF taxes > 0 net = grossPay – taxes ELSE net = grossPay ENDIF WRITE name, net
  • 7. E nd Multiline S tructures READ name, grossPay, taxes IF taxes > 0 net = grossPay – taxes ELSE net = grossPay ENDIF WRITE name, net S ee the IF/E LS E /E NDIF as cons tructed above, the E NDIF is in line with the IF. The s ame applies for WHILE /E NDWHILE etc…
  • 8. Language Independence Res is t the urge to write in whatever language you are mos t comfortable with, in the long run you will s ave time. Remember you are des cribing a logic plan to develop a program, you are not programming!
  • 9. T Sel ion St uct e he ect r ur yes no amount < 100 interestRate = .06 interestRate = .10 IF amount < 100 interestRate = .06 Pseudocode  ELSE Interest Rate = .10 ENDIF
  • 10. T L he oopingSt uct e r ur In flowcharting one of the more confus ing things is to s eparate s election from looping. This is becaus e each s tructure us e the diamond as their control s ymbol. In ps eudocode we avoid this by us ing s pecific keywords to des ignate looping WHILE /E NDWHILE RE PE A T/UNTIL
  • 11. W E/E HIL HIL NDW E Start count = 0 WHILE count < 10 ADD 1 to count count = 0 WRITE count ENDWHILE WRITE “The End” count Mainline <10  Modular count = 0 Write “The End” WHILE count < 10 add 1 to count DO Process ENDWHILE Stop write count WRITE “The End” Process ADD 1 to count WRITE count
  • 12. R PE T/UNT E A IL Start count = 0 REPEAT count = 0 ADD 1 to count WRITE count UNTIL count >= 10 add 1 to WRITE “The End” count Mainline  Modular write count count = 0 REPEAT DO Process count <10 UNTIL count >= 10 WRITE “The End” Write Process “The End” ADD 1 to count Stop WRITE count
  • 13. A a a &Disa a a dv nt ges dv nt ges Flowchart Advantages: Pseudocode Advantages  Standardized  Easily modified  Visual  Implements structured concepts  Done easily on Word Processor Flowchart Disadvantages: Pseudocode Disadvantages:  Hard to modify  Not visual  Structured design elements not  No accepted standard, varies from implemented company to company  Special software required
  • 14. A ofDaa ccess t T R A st t he E D aementt l t comput t getav l fr a inputdev a st e itin a els he er o aue om n ice nd or memor l t y ocaion. Howt dea w h memor l t o l it y ocaions? Memory locations are identified by their addresses, we give them names (field names / variable names) using words descriptive to us such as ctr as opposed to a location addresses such as 19087.
  • 15. Rules for Variable Names • Begin with lowercase letter • Contain no spaces • Additional words begin with capital • Unique names within code • Consistent use of names
  • 16. Working with Fields Calculations Selection + add > greater than - subtract < less than * multiply = equal to / divide >= greater than or equal to ** or ^ exponentiation <= less than or equal to () grouping <> not equal to