Java Volleyball scoring program arrays and loops : <p>I am new to coding. Please be gentle with me.
I have been charged with creating a program that compares the scores of two competing volleyball. To win a match in volleyball, a team must get 25 points. But the team must also win by 2. These two teams are going to play five matches.</p>

<p>The program should accept from the user the scores for each team one match at a time. If at any time that user enters scores that violate the 25-point rule or the “win by 2” point rule, print an error on the screen and make the user enter both scores again.</p>

<p>When the user is finished entering the scores, print which team won the game, that is the team that won the most matches.</p>

<p>You have to use arrays and loops in this assignment. </p>

<p><strong>My program is only scoring the first set of scores in the array.</strong>
<strong>How do I make it store all five sets of scores?</strong>  </p>

<pre><code>public static void main(String[] args) {
        int team1[];
        int team2[];
        team1=new int[5];
        team2=new int[5];
        int counter1=0;
        int counter2=0;
        int k = 0;


        for (int i=0;i&lt;=4;i++){       
        Scanner scanint = new Scanner(System.in);
        System.out.println("Enter the number of points Team 1 earned in Match " + (i+1));
        team1[i] = scanint.nextInt();
        System.out.println("Enter the number of points Team 2 earned in Match " + (i+1));
        team2[i] = scanint.nextInt();

////////////////////////////////////////////
        if (team1[i] &lt; 25 &amp; team2[i] &lt; 25){
            System.out.println("That cannot be. One team must get at least 25 points. Please re-enter the data.");
            System.out.println("Enter the number of points Team 1 earned in Match " + (i+1));
        team1[i] = scanint.nextInt();
        System.out.println("Enter the number of points Team 2 earned in Match " + (i+1));
        team2[i] = scanint.nextInt();
        }



        else if (team1[i] - team2[i] &lt; 2 || team2[i] - team1[i] &lt; 2){
           System.out.println("That can't be. One team must win by at least two points. Please re-enter the data.");
            System.out.println("Enter the number of points Team 1 earned in Match " + (i+1));
        team1[i] = scanint.nextInt();
        System.out.println("Enter the number of points Team 2 earned in Match " + (i+1));
        team2[i] = scanint.nextInt();
        }

        else {
            System.out.println("Enter the number of points Team 1 earned in Match " + (i+1));
        team1[i] = scanint.nextInt();
        System.out.println("Enter the number of points Team 2 earned in Match " + (i+1));
        team2[i] = scanint.nextInt();
        }


        /////////////////////////////////////////////

        if (team2[i] &lt; team1[i]){
           counter1++;}
       else{ counter2++;}

    }
     if (counter1 &gt; counter2)  {
      System.out.println("Team 1 has won the game.");}
      else{
              System.out.println("Team 2 has won the game.");
              }
</code></pre>
