home *** CD-ROM | disk | FTP | other *** search
/ Java Certification Exam Guide / McGrawwHill-JavaCertificationExamGuide.iso / pc / Web Links and Code / exer / chap1 / exer0108 / Avg.java
Encoding:
Java Source  |  1997-04-19  |  283 b   |  13 lines

  1. class Avg {
  2.    public static void main(String[] args) {
  3.       double a = 5.1;
  4.       double b = 20.32;
  5.       double c = 32.921;
  6.       System.out.println(findAvg(a, b, c));
  7.    }
  8.  
  9.    double findAvg(double a, double b, double c) {
  10.       return (a + b + c) / 3.0;
  11.    }
  12. }     
  13.