Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please provide java code for the below Task 02: Quick Fire (5 marks) The media streaming business is very dynamic. Changes occur every second (alright,

please provide java code for the below

image text in transcribedimage text in transcribed

Task 02: Quick Fire (5 marks) The media streaming business is very dynamic. Changes occur every second (alright, not every second, but you get the point). Most of the utility methods that you've implemented in Task 01 are essential to for administrative purpose. However, we need to do more, especially in this data oriented business. We need to have some rapid fire methods to pull vital information from our streaming program. There will be loads, but we must be realistic (the task is only worth 5 marks). Therefore, we are going to look at the two most important information to have in-hand, so the management would be happy to get rapid response from us. 1 - You are required to complete the getTotalFeesGroupByMedia () method to provide the current outstanding fees from all subscribers group by the media type, e.g., given the data of all subscriber for that particular month, the method will return the total fees for Movies, for Books, and for Songs. This information can help the management to decide, which media is the most profitable, and they can decide for possible adjustment in the future, i.e., maybe buying more movies for the library (to keep things fluid). Similar to Task 01, you need to use Java 8 Streams, lambda expression and (or) method references to complete this task. There are getters provided in the MyMedia class to help facilitate this operation. Read the comments in the method body for details. The solution is simple, but make sure you cater your solution to the current structure of the program (i.e., check what is available in the codes, and work it out from there) = [3 marks]. 2 - You are required to complete the getCountGroupByMedia () method to retum the number of items available inside each subscriber media library, group by the media type, e.g., Given the library of subscriber A as (Movie - 3, Book - 2, Song - 3), and subscriber B as (Movie 2, Book - 1, Song - 2), your method should return (Movie - 5, Book - 3, Song - 5) - the total count for each media for all subscribers. This will give the management an opportunity to evaluate the popularity of item in respect to the media type - again, this can be a factor to determine future media offerings (this time based on user consumption). As a good programmer, you should be able to adapt the programming idiom that you've previously applied in getTotalFeesgroupByMedia () method. The logic is essential the same, and you only need to call a different intermediate and terminal operators for your streams. There is no point of re-inventing the wheels (even the marks allocated here reflect that =[2 Marks ]. Notes: Don't overthink the solution - it is not as complex as it sounds, and do check the comments provided in the method body (this is important that I have to repeat it here, again). You can use the test function program to evaluate your method, similar to lab assignment 01. Do remember, that whenever possible, always use the simple approach to complete the methods

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

Students also viewed these Databases questions