Question: Hello i have java programming assignment could you help me? We should use hashmap You have collected a file of movie ratings where each movie
You have collected a file of movie ratings where each movie is rated from 1 (bad) to 5 (excellent). Each rating then consists of two lines: the name of the movie followed by the numeric rating from 1 to 5. Here is a sample rating file with four unique movies and seven ratings: Harry Potter and the Half-Blood Prince Harry Potter and the Half-Blood Prince Army of the Dead Harry Potter and the Hal-Blood Prince Army of the Dead The Uninvited Pandorium Write a program that reads a file in this format, calculates the average rating for each movie, and outputs the average along with the number of reviews and review counts. Here is the desired output for the sample data: Harry Potter the Half-Blood Prince: 3 total reviews, average of 4.3/5 Rate 4: 2 review Rate 5 Army of the Dead: 2 total reviews, average of 1.5/5 Rate l Rate 2 The Uninvited: I total review, average of 475 Rate 4 Pandorium: I total review, average of 3/5 Rate 3 I review I review I review review I review Use a HashMap or multiple HashMaps to calculate the output. Your map(s) should index from a string representing each movie's name to integers that store the total number of reviews and each number of reviews of movie For example, Total Reviews: 3, Rate eview, Rate 2: 2 reviews, Rate 3: 1 review, Rate 4: 1 review, Rate 5: 1 reviews
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
