Can't you use averageRating() as an argument in preferanceFactor(), so that the preferanceFactor has 2 arguments?
virtual double preferanceFactor(double avrRating, double genAvrRating);
and then when calling prefFact you pass in the averageRating(x,y) as first arg? Is that acceptable?
Or you can just pass 3 arguments (2 just as averageRating arguments, and 3rd is genAvRate.
virtual double preferenceFactor(int numberOfMovies, double sumOfRatings, double generalAverageRating) {
return averageRating(numberOfMovies, sumOfRatings)/generalAverageRating;
}
and then in the prefFact funct u call averageRating() for 1st two args?