User Tools

Site Tools


cplusplus:control_structures_repetition_in_algorithms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cplusplus:control_structures_repetition_in_algorithms [2017/02/06 17:32] mithatcplusplus:control_structures_repetition_in_algorithms [2019/02/11 16:38] – [Control Structures: Repetition in Algorithms] mithat
Line 5: Line 5:
  
 Mithat Konar\\  Mithat Konar\\ 
-2017-02-06+2019-02-11
  
 ===== Introduction ===== ===== Introduction =====
Line 18: Line 18:
   * "Repeat something a known number of times."   * "Repeat something a known number of times."
   * Uses a counter variable.   * Uses a counter variable.
-  * Pseudo code:<code>Set counter's initial value+  * Pseudocode:<code>Set counter's initial value
 While counter has not yet exceeded the STOP_VALUE While counter has not yet exceeded the STOP_VALUE
     Do something     Do something
Line 30: Line 30:
 ===== Sentinel-controlled repetition ===== ===== Sentinel-controlled repetition =====
   * "Repeat as long as a sentinel condition is not matched."   * "Repeat as long as a sentinel condition is not matched."
-  * Pseudo code:<code>Get input value+  * Pseudocode:<code>Get input value
 While input value is not SENTINEL value While input value is not SENTINEL value
     Do something     Do something
Line 41: Line 41:
 ===== Input validation ===== ===== Input validation =====
     * "Prevent moving to next section until user has entered valid data."     * "Prevent moving to next section until user has entered valid data."
-    * Pseudo code:<code>Get input value from user+    * Pseudocode:<code>Get input value from user
 While input value is not valid While input value is not valid
     Get input value from user</code>     Get input value from user</code>
Line 47: Line 47:
 ===== Menus ===== ===== Menus =====
   * Repeating menus can be implemented with sentinel control.   * Repeating menus can be implemented with sentinel control.
-  * Pseudo code:<code>Show menu+  * Pseudocode:<code>Show menu
 Get menu choice from user Get menu choice from user
 While input value is not QUIT value While input value is not QUIT value
Line 56: Line 56:
 ===== Iterators ===== ===== Iterators =====
   * Do something to every item in a collection.   * Do something to every item in a collection.
-  * Pseudo code:<code>For each item in collection+  * Pseudocode:<code>For each item in collection
     Do something with or to the item</code>     Do something with or to the item</code>
  
  
cplusplus/control_structures_repetition_in_algorithms.txt · Last modified: 2020/02/10 21:45 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki