Question
public class Utilities{ /** * step 3.1 * * Computes the average of any number of ratings * * @param ratings A list of integer
public class Utilities{
/**
* step 3.1
*
* Computes the average of any number of ratings
*
* @param ratings A list of integer ratings in the range of 1-5 inclusive
* @return The average of all ratings in the list as a double
*/
public double averageRating(ArrayList
return 0.0; //replace 0.0
}
/**
* step 3.2
*
* Computes the Bayesian average of any number of reviews
*
* Hint: You can call your method from 3.1 to compute the standard average of the ratings then
* call the Bayesian average method from part 1 to compute the Bayesian average.
*
* @param ratings A list of integer ratings in the range of 1-5 inclusive
* @param numberOfExtraRatings The number of extra ratings to be added to the average
* @param extraRatingValue The value of the extra ratings
* @return The Bayesian average of all ratings in the list as a double
*/
public double bayesianAverage(ArrayList
return 0.0; //replace 0.0
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started