Code in the main method

(Display Listing 2.)

The code in the main method consists of the following sequence of actions:

  1. A priming read.
  2. A while loop.
  3. A doTogether block that is executed when the user enters an odd integer causing the loop to terminate.