PROGRAMMING LOOPs: FOR-NEXT & WHILE

Task: REPEAT SOME INSTRUCTIONS

  1. If we want to repeat some programming instructions for several times we can use For-Next Loop.
  2. For example the next program repeats functions robotLeft() and robotRight() for 10 times and robot will do a funny "dancing" move.

An example of FOR-NEX loop.{#fig:for_next_loop}

  1. Experiment a bit more with such programming techniques.

Questions:

  1. What is a programming loop?
  2. Name a situation where programming pool is used.

Summary:

Repeating Code in Functions

Using functions may not seem to be very convenient. But it is a huge deal, and helps to make a clean code. It is advised to use functions ether if the code is used only once.

Where the code is repeated several times in different occasions in the program the use of the functions is trivial.

Issues:

<++>

<++>