Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q4 Streaming Service Videos (Total 5 marks) A streaming service can display videos to users ordered in multiple ways. You are required to provide code

image text in transcribed

Q4 Streaming Service Videos (Total 5 marks) A streaming service can display videos to users ordered in multiple ways. You are required to provide code that will allow an ArrayList of Video objects to be sorted in two different ways: a) Sort 1: Each video has a popularity score between 0 and 100 , inclusive. The higher the popularity score, the more popular the video. The videos should be sorted from most popular to least popular. b) Sort 2: Each video has a category and title. Order the video into their appropriate categories (categories will be displayed in alphabetical order) and then alphabetically by title in each category. The Video class is provided below for you to use. class video 1 private string title; private String category; private int popularity; public Video (String title, String category, int popularity) 1 this.title = title; this. category = category; this.popularity = popularity; f public Video (String title, String category) i this (title, category, 0); 1 public String getitle() i return title; f public string getCategory () 1 return category; f public int getPopularity() 1 return popularity; b Coverride public string tostring() 1 return title +" (" + category + ") ("+ popularity + " ) "; \}

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

Explain the purpose of pro forma financial statements.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago