In Java, Create Movie class, which has private fields for title, director, rating. It has a constructor to initialize these fields and a toString method for printing movie details. There is also a getRating method to retrieve the movie rating. Create Rating Comparator class which implements the Comparator interface for comparing movies based on their ratings. Create DemoMovies Class. Initialize necessary data structures like Linked List, TreeMap for rating as key and Movie from Movie class as value, TreeSet, and ProtiyQueue. Use a loop to take user input for movie detailsuntil the user enters 'WWW' as the movie title.Inside the loop, for each movie, create a Movie object, add it to various data structures that is title, director and rating based on the constructor.Add the Movie object to the Linked List. Add the rating and the object to the TreeMap.Add the rating to the TreeSet. Add the Movie object to the PriorityQueue.Display the entered movies. Sort and display Movies by rate by using TreeMap to automatically sort Movies by rate and display them. Remove Movies with Rating less than 5.0 using removeAll.Use an iterator to go through the list of Movies and remove those with a rating less than 5.0(use while loop for iterator and if statement for rate less than 5). Create an array list to add the unrented movies and add them to the list created. Use a tree map to store movies with a rating greater than or equal to 5.0and display them sorted by Rate.Display the keys and values from the TreeMap.Create a PriorityQueue from the movies stored in the TreeMap and display it based on movie ratings.
In Java, Create Movie class, which has private fields for title, director, rating. It has a constructor to initialize these fields and a toString method for printing movie details. There is also a getRating method to retrieve the movie rating. Create Rating Comparator class which implements the Comparator interface for comparing movies based on their ratings. Create DemoMovies Class. Initialize necessary data structures like Linked List, TreeMap for rating as key and Movie from Movie class as value, TreeSet, and ProtiyQueue. Use a loop to take user input for movie detailsuntil the user enters 'WWW' as the movie title.Inside the loop, for each movie, create a Movie object, add it to various data structures that is title, director and rating based on the constructor.Add the Movie object to the Linked List. Add the rating and the object to the TreeMap.Add the rating to the TreeSet. Add the Movie object to the PriorityQueue.Display the entered movies. Sort and display Movies by rate by using TreeMap to automatically sort Movies by rate and display them. Remove Movies with Rating less than 5.0 using removeAll.Use an iterator to go through the list of Movies and remove those with a rating less than 5.0(use while loop for iterator and if statement for rate less than 5). Create an array list to add the unrented movies and add them to the list created. Use a tree map to store movies with a rating greater than or equal to 5.0and display them sorted by Rate.Display the keys and values from the TreeMap.Create a PriorityQueue from the movies stored in the TreeMap and display it based on movie ratings.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education