Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// TODO create a method to return the outstanding fees from all accounts group by the media type. // You should make use of Java

image text in transcribed

image text in transcribed

image text in transcribed

// TODO create a method to return the outstanding fees from all accounts group by the media type. // You should make use of Java 8 Streams and lambda expression to do this - return map // TIP: // declare a map collection that will store the total fees you generate - check out the generic types // for your map as per the method signature. // // Check MyMedia class and explore the getters you can call for each media type. // For each subscriber, you need to calculate the total fees for each media type. As you traverse your // subscriber map, you will then call the list of each media, and calculate the total. // // For e.g., if you have 5 subscribers, you will have 4 list of Movie, Book and Song. So you need to // calculate the total fees for all movies, and then all books and lastly, all songs. // // *SECRET TIP: // With Java Stream, lambda expression and method reference, you can do this in 3 lines // (one for each media type). Use subscriber stream to get media, then individual list can be // processed as stream (all in a single pipeline) - but don't get hung up on it, use anything that you're // comfortable with ! -> the read tip :)

public Map getTotalFeesGroupByMedia() {

Map mapMedia = new HashMap(); }

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

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_2

Step: 3

blur-text-image_3

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

What are the five steps in good receivables management?

Answered: 1 week ago