PBL Unit 1 / Week 8

  • In coding, “iteration” means to repetitively perform a set of actions or operations, typically with the purpose of processing or examining a collection of items, such as a list, array, or other data structures
  • It is a fundamental concept in programming and is often used when you need to perform a specific task multiple times or when you want to process a collection of data, such as a list or an array. Below is an example of an iteration, and its uses.
  • Indefinite iteration, also known as conditional or while-loop iteration, involves repeating a block of code as long as a specified condition remains true. Unlike definite iteration, where you know the exact number of iterations in advance, with indefinite iteration, the loop continues as long as the condition is met
  • If the condition becomes false at any point, the loop terminates. Below is an example of the layout
  • Loop control statements are used to manage the flow of loops and determine when to exit, skip, or repeat iterations within a loop. There are three primary loop control statements: break, continue, return