Illustrates the use of arrays

/** Report on a round of golf at St. Andy?s.
 *
 *  Taken from Core Web Programming from
 *  Prentice Hall and Sun Microsystems Press,
 *  .
 *  © 2001 Marty Hall and Larry Brown;
 *  may be freely used or adapted.
 */

public class Golf {
  public static void main(String[] args) {
    int[] pars   = { 4,5,3,4,5,4,4,3,4 };
    int[] scores = { 5,6,3,4,5,3,2,4,3 };
    report(pars, scores);
  }

  /** Reports on a short round of golf. */

  public static void report(int[] pars, int[] scores) {
    for(int i=0; i

Permanent link to this article: http://bangla.sitestree.com/illustrates-the-use-of-arrays/

Leave a Reply