title: How can I make it so when the user inputs "n" times the program will stop?
body: <p>I want to make it so when the user inputs a certain amount of times the program will terminate. How can I achieve this with my current code? </p>
  
  <pre><code>num = input.nextInt();
  System.out.println("Score for David");
  ArrayList&lt;Integer&gt; al = new ArrayList&lt;Integer&gt;();
  int count = 0;
  int limit = num; 
  while(true &amp;&amp; count &lt; num){
  while(true){
     int check = input.nextInt();
  }
  </code></pre>