SlideServe
Menu
Préférences
© SlideServe · v2026

Pseudocode

alexavier avatar
17 diapositives · 1K Views · Nov 12, 2012

C Programming Technique – Firdaus-Harun.com. Pseudocode. Agenda. Intro to Pseudocode Pseudocode vs Flowchart Technique – Write pseudocode Examples. What’s Pseudocode ?. Artificial and Informal language Helps programmers to plan an algorithm Similar to everyday English

Pseudocode - slide 1
01 / 17Pseudocode
1 / 17

Télécharger la présentation

Pseudocode
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. C Programming Technique – Firdaus-Harun.com Pseudocode

  2. Agenda • Intro to Pseudocode • Pseudocode vs Flowchart • Technique – Write pseudocode • Examples

  3. What’s Pseudocode ? • Artificial and Informal language • Helps programmers to plan an algorithm • Similar to everyday English • Not an actual programming language

  4. E.g : Pseudocode Read A, B Calculate C = A*B Display C Stop

  5. Technique • Do not write Start in every pseudocode • Parallelogram – Read / Get OR Display / Print • Rectangle – Specify the actions • E.g: • Calculate A = B + C OR A equals to B plus C • Average = total / count • Final price equals price of item plus sales tax • Diamond – [Next »]

  6. Technique (..Cont.) • Diamond • Selection – IF , IF / ELSE and IF / ELSE IF IF A is less than B BIG = B SMALL = A ELSE BIG = A SMALL = B • Repetition – WHILE / DO/WHILE / FOR [Next example]

  7. Comparative Between Flowchart vsPseudocode • Flowchart • A graphical way of writing pseudocode • Rounded rectangle – terminal • Parallelogram – input / output • Rectangle – actions • Diamonds – decision / conditional • Circles – connector

  8. Start Terminal. Program start here Stop Terminal Program end here Input. Enter values for A and B Process Output E.g : Flowchart

  9. Comparative Between Flowchart vsPseudocode (..Cont.) • Pseudocode • No syntax rule – Independent from any programming language • Write in an ordinary language • Uses a structure resembling computer structure • No connector between pages

  10. E.g : Pseudocode Read A, B Calculate C = A*B Display C Stop

  11. E.g : Pseudocode Read A, B – Input Calculate C = A*B - Action Display C - Output Stop - Terminal

  12. Example 2 (Selection) Read A, B IF A is less than B BIG = B SMALL = A ELSE BIG = A SMALL = B Write / Display BIG, SMALL Stop

  13. Example 2 (Selection) Read A, B - Input IF A is less than B - Selection BIG = B - Action SMALL = A - Action ELSE - Selection BIG = A - Action SMALL = B - Action Write / Display BIG, SMALL - Output Stop - Terminal

  14. Example 3 (Repetition) Set count to zero Set total to zero Read number WHILE ( not end-of-data ) increment count by 1 total = total + number read number IF ( count > 0 ) then average = total / count Display average Stop

  15. Advantages • Converting a pseudocode to a programming language is much more easier than converting a flowchart. • As compared to flowchart, it is easier to modify a pseudocode of a program logic when program modifications are necessary.

  16. Limitations • In the cases of pseudocode, a graphic representation of program logic is not available. • There are no standard rules to follow for using a pseudocode. • Different programmers use their own style of writing pseudocode; and hence, • Communication problem occurs due to lack of standardization.

  17. Class Tutorial • *Using previous Flowchart tutorial. • Write a pseudocode to calculate Area and Perimeter of a trapezoid. • Write an algorithm to set a Median for given number : ………………………..