title: Generating random simple math division problems
body: <p>I'm making a simple Android app for my daughter so she can do math problems. I found it fairly easy to generate addition, subtraction and multiplication questions at random, however division is more tricky.</p>
  
  <p>I don't want to get into decimals, so I have to check each is divisible without remainder. This is what I am working with...</p>
  
  <pre><code>public void genDivQuestion() {
          text = (TextView) findViewById(R.id.textView1);
          text.setText(divisible());
          answer = first / second;
  }
  
  public String divisible() {
          first = RandomNumGen.getRandIntBetween(2, 12);
          second = RandomNumGen.getRandIntBetween(2, 12);
          if (first % second == 0) {
              return first + " \u00F7 " + second + " = ?";
          } else {
              return "0";
          }
  }
  </code></pre>
  
  <p>I'm not sure what to do at the line "return "0";". If I try calling divisible() to try again, the app just crashes.</p>
  
  <p>This is the RandomNumGen class, which I appropriated from a beginner's book by James Cho:</p>
  
  <pre><code>import java.util.Random;
  
  public class RandomNumGen {
  
      private static Random rand = new Random();
  
      public static int getRandIntBetween(int lowerBound, int upperBound) {
          return rand.nextInt(upperBound - lowerBound) + lowerBound;
      }
  
      public static int getRandInt(int upperBound) {
          return rand.nextInt(upperBound);
      }
  }
  </code></pre>