Question: JAVA LANGUAGE USING INTELLIJ IDE Add the following functionality to the eatings.Song class: - A public method named addRating that takes a [reference to a]

![a] an object of type Rating as a parameter (The type of](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a7a87f32c_20066f3a7a81c491.jpg)

Add the following functionality to the eatings.Song class: - A public method named addRating that takes a [reference to a] an object of type Rating as a parameter (The type of the input is Rating) and returns void - This method will be called when a Reviewer rates this Song. You should store all added Ratings in a Linked List as an instance variable. Note that you can add any instance variables you'd like, including a Linked List of Ratings - In the next method, you will return your Linked List containing all Ratings in the order in which they were added. This implies that you should append Ratings to the end of the List. - A public Method named getRatings that takes no - A public Method named getRatings that takes no parameters and returns a LinkedListNode of Ratings - This method returns the head of a Linked List containing all Ratings that have been added to this Song. - The returned Linked List must return the Ratings in the order in which they were added. For example, the first Rating that was added must be the first value in the list. - A public method named averageRating that takes no parameters and returns a double - This method return the average of all the Rating for this Song - Technically, ratings of 1 should be ignored, but 1 forgot to include a test for that, so you'll get away with it if you don't ignore them... - A public method named didReviewerRateSong that takes a String representing the ID of a - A public method named didReviewerRateSong that takes a String representing the ID of a reviewer and returns a boolean - This method returns true if the reviewer with the given ID has rated this Song, false otherwise. - Update the addRating method to prevent a Reviewer from rating a Song multiple times - You should call your didReviewerRateSong method from your addRating method to check if the reviewer rated this Song yet. If it returns true, don't add the new Rating to your Linked List - A public method named removeRatingByReviewer that takes a Reviewer as a parameter and returns void - This method will remove any Rating made for this Song by the given Reviewer - Note that since you are preventing multiple Rating from a Reviewer in your addRatinq method. vou can A public method named removeRatingByReviewer that takes a Reviewer as a parameter and returns void - This method will remove any Rating made for this Song by the given Reviewer - Note that since you are preventing multiple Rating from a Reviewer in your addRating method, you can assume that the Reviewer has rated this Song at most once
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
