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 ratings){

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 ratings, int numberOfExtraRatings, double extraRatingValue){

return 0.0; //replace 0.0

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!