A good answer might be:

No—each group can have a different number of students in it.


Start on the Program

Here is a start on coding the program:

import java.io.*;
class TestGroups
{
  public static void main ( String[] args ) throws IOException
  {
    String line;
    BufferedReader stdin = new BufferedReader( 
        new InputStreamReader( System.in ) );
    int value;     // the value of the current integer

    // Group "A"
    int sizeA;     // the number of students in group "A"
    int sumA = ___;   // the sum of scores for group "A"

    System.out.println("How many students in group A:");
    line   = stdin.readLine();
    sizeA  = Integer.parseInt( line.trim() );

    int count = _______; // initialize count

    while ( count < ________ )
    {
      System.out.println("Enter a number:");
      line   = stdin.readLine();
      value  = Integer.parseInt( line.trim() );
      ___________________ ; // add to the sum
      ___________________ ; // increment the count
    }

    if ( sizeA > 0 )
      System.out.println( "Group A average: " + ___________________  );
  
    else
      System.out.println( "Group A  has no students" );
  
    // Group "B"
  
    . . . .  more code will go here . . . . 
  }
}

QUESTION 9:

Fill in the missing code. Note: the relational operator < in the while loop is different than in the previous program.