Looping Statements

February 26th, 2016

Slides

Loop Practice

  1. Make a method that rolls some input number of dice using a for loop.
  2. Make a method that rolls some input number of dice using a while loop.
  3. Make a method that simulates the following experiment: See how many rolls it takes to roll x number of dice of value y.
  4. Make a method that prints out all odd integers up to some max value.
  5. Make a method that tests whether or not an input parameter is prime.
  6. Make a method that prints out all prime numbers up to a maximum value.