AvgDriver

AvgDriver - public static void main(String args) { Averager...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// This example is from _Java Examples in a Nutshell_. (http://www.oreilly.com) // Copyright (c) 1997 by David Flanagan // This example is provided WITHOUT ANY WARRANTY either expressed or implied. // You may study, use, modify, and distribute it for non-commercial purposes. // For any commercial use, see http://www.davidflanagan.com/javaexamples / /* A "driver" class to test the Averager class */ public class AvgDriver {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public static void main(String args) { Averager a = new Averager(); for(int i = 1; i <= 100; i++) a.addDatum(i); System.out.println("Average: " + a.getAverage()); System.out.println("Standard Deviation: " + a.getStandardDeviation()); System.out.println("N: " + a.getNum()); System.out.println("Sum: " + a.getSum()); System.out.println("Sum of squares: " + a.getSumOfSquares()); } }...
View Full Document

Ask a homework question - tutors are online