2023 CS162 Lab 4 Create a class named LibraryBook that contains fields to hold the title author and | Assignment Collections
Computer Science 2023 Lab 4 Comparator Solution
2023 CS162 Lab 4 Create a class named LibraryBook that contains fields to hold the title author and | Assignment Collections
Lab 4
Create a class named LibraryBook that contains fields to hold the title, author, and pagecount. It should have set and get methods for each field.
Write an application that instantiates five LibraryBook objects and prompts the user for values for the data fields. The objects should be stored in either an Array or an ArrayList. Then prompt the user to enter which field the libraryBooks should be sorted by – title, author, or pageCount. Perform the requested sort procedure and display the LibraryBook objects in the sorted order.
Our book has information about sorting an Array using the Array class sort method, which uses a comparator. The ArrayList class also has the ability to use a comparator, though it is set up slightly differently, using the Collections.sort. A quick google search got me these web sites, which seem pretty clear and use something similar to what we did with the Hand class in our Card Game project.
We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.