Question: Use Java language, please. /** * For a review sentence, estimate the movie rating based on the words * in the review. * For each

Use Java language, please.

/**

* For a review sentence, estimate the movie rating based on the words

* in the review.

* For each word, find its index in the words list, then compute

* its average score (scores[index]/wordCount[index]) and add it to a

* cumulative review score.

* Count up the number of words in the review and use the count

* and the cumulative review score to get an averaged movie score.

* @param review: The text of the review.

* @param words: The array of words found in all reviews.

* @param scores: The cumulative score for each word in words.

* @param wordCount: The number of times each word in words appears in all the reviews.

* @param numberOfWordsSoFar: The number of elements in the arrays to be used.

* @return the average score for the words in review.

*/

public static double scoreReview(String review, String[] words, double[] scores, int[] wordCount, int numberOfWordsSoFar) {

return 0.0; // Change this

}

Thank you so much!

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!