
function MeanProblem(x) {
    this.Mean       = new Number() ;
    this.count      = new Number() ;
    this.a_subtotal = new Number() ;
    this.data       = new List()   ;
    this.count      = 0            ;
    this.a_subtotal = 0            ;
    this.Mean       = ""           ;
    if ((x == undefined) || (x == null)) {
        x = "" ;
    }
    (this.data).assign(x)              ;
}

MeanProblem.prototype.assign = function(x) {
    (this.data).assign(x) ;
}

MeanProblem.prototype.subtotal = function() {
    this.count      = 0    ;
    this.a_subtotal = 0    ;
    do {    
        this.count++       ;
	     this.a_subtotal += parseInt((this.data).iterate() ) ;
    } while ((this.data).eof() == false) ;
    return (this.a_subtotal) ;
}

MeanProblem.prototype.evaluate = function() {
    this.subtotal() ;
    this.Mean = eval(this.a_subtotal/this.count) ;
    return this.Mean
}

MeanProblem.prototype.mean = function () {
    return this.Mean ;
}




