title: Trying to find the average amount of attempt it takes for Tom to roll a six on: 10 repetitions
body: <p>It takes the total number of rolls and divides them by 10. For example, if it took 56 rolls so my average is 5.6.</p>
  
  <pre><code>        Random numGen = new Random ();
  
          int numOfAttempt = 0;
          int Attempt = 0;
          int avrBefore = 0;
          int avrAfter = 0;
  
  
          for (int i = 1; i &lt;= 10; i++)
  
              do {
  
                  Attempt = numGen.Next (1, 7);
                  Console.WriteLine (Attempt);
                  numOfAttempt++;
                  avrBefore = numOfAttempt;
                  avrAfter = avrBefore / 10;
  
              } while (Attempt != 6); 
  
          Console.WriteLine ("He tried " + numOfAttempt + " times to roll a six.");
          Console.WriteLine ("The average number of times it took to get a six was " + avrAfter);
          Console.ReadKey ();
  </code></pre>