public class Demonstrate {
 public static void main (String argv[]) {
  Movie movies[] = {new Movie (5, 6, 3),
                    new Movie (8, 7, 7),
                    new Movie (7, 2, 2),
                    new Movie (7, 5, 5)};
  int counter, sum = 0;
  for (counter = 0; counter < movies.length; ++counter)
    sum = sum + movies[counter].rating();
  System.out.print ("The average rating of the " + movies.length);
  System.out.println (" movies is " + sum / movies.length);
 }
}
