title: How do I use modulus for selection of 4 statements iterated through a loop of 100 in Java?
body: <p>I am trying to use a loop in conjunction with the modulus operator. I need to use the modulus operator as a selection tool, to select one of 4 statements. These 4 statements have to be selected one at a time until the loop has executed 20 times. This means that each of the 4 statements has been executed 5 times.</p>
  <p>I do not understand how the modulus operator can specifically select one of these statements one after another through the loop of 20 iterations. How does the loop know when to execute any of the statements at the correct time. So we have the four statements 1,2,3, and 4. Then this is repeated until the loop of 20 iterations has been cycled through.</p>
  <p>I understand that the modulus operator returns the remainder of a division. And a for loop can be used to iterated over some code. It is just the combination of these things that I am struggling with.</p>
  <p>Also I understand that a switch statement could be used also.</p>
  <p>Can anybody please explain how to use the modulus operator to select one of four statements repeatedly over a loop of 20 so that each statement has been executed 5 times in this sequence?</p>
  <p>do 1 thing (one loop iteration)
  do 2 thing (2nd loop iteration)
  do 3 thing 3rd loop iteration)
  do four thing (4th loop iteration)</p>
  <p>This sequence must be repeated in order, returning to (1thing) and repeated until 20 iterations has been completed.</p>
  <p>The use of modulus is required.</p>