The third class is OrderedList, which is a utility class that contains two overloaded implementations of a
method named checkSorted, which determines whether a List object, supplied as a parameter, is in strictly
ascending order. Both methods should be class (static) methods. The first of the overloaded methods should
accept a list that contains elements that implement Comparable. The second should instead be supplied an
additional parameter that is an object of a class that implements the Comparator interface. Refer to the
signatures of the two sort methods in the predefined Java Collections class as a model for how these two
methods should be defined. Do not duplicate code, but instead ensure that first overloaded method calls the
The fourth outer class is the class that contains the main method. The main method should allow the user to
select the input file from the default directory by using an object of the JFileChooser class. It should then
populate an ArrayList of objects of type Polynomial as it reads in the lines of the file. As the polynomials
are read in, they should also be displayed in the format provided by the toString method. Should the
InvalidPolynomialSyntax exception be thrown, it should be caught and a JOptionPane message should
be displayed containing the reason for the invalid syntax. The list of polynomials should be then checked to see
whether it is in sorted order according to two orderings. The first check is the one that uses the compareTo
method of the Polynomial class. We refer to this first ordering as the strong order. The second results from
the use of a comparator. We refer to it as the weak order. It should display whether it fails to be sorted by either
of both of the two orderings or if it is sorted according to both.
Inside the main class, a named lambda expession should be defined that implements the Comparator interface.
Its compare method should consider only the exponents and not the coefficients in comparing the polynomials,
much like how functions are categorized by Big-O.
As an example, consider the following list of polynomials:
4.0×3 + 2.5x + 8.0
5.0×4 + 5.0
4.5×4 + 5.7×2 + 8.6
This list fails to be sorted by the strong order that considers both the coefficients and exponents because the
third polynomial is less than the second because of the coefficients on the x4 terms. The coefficient on that term
in the second polynomial is 5.0, which is greater than 4.5, the coefficient on the corresponding term in the third
They are sorted by the weak order that considers only the exponents, however. The third polynomial is greater
than the second because the third has a x2 term and the second one does not.
Why Work with Us
Top Quality and Well-Researched Papers
Our writers have been trained on how to handle papers placed by our clients. The writer must read and understand before embarking on writing the papers. In case of any issue that needs clarification, writers are encouraged to ask the client or support.
Professional and Experienced Academic Writers
Our team comprises of the best writers and editors. We do thorough vetting during recruitment to make sure that our writers have the knowledge and experience we aspire in the team.
Free Unlimited Revisions
Our aim is to give the client the best outcome. If for some reason you are not satisfied with the wok done, you can ask the paper to be revised or rewritten. This will be done to your satisfaction with no extra charges.
Prompt Delivery and 100% Money-Back-Guarantee
We have writers who work round the clock. This helps in making sure that all our clients’ papers are delivered on time. If we have issues with the deadline, we will ask for extension. If its not possible, the money is fully refunded.
Original & Confidential
Our clients’ confidentiality is highly respected. We can never disclose our clients’ details to third parties. In the same regard, we strive to give our clients 100% original papers. We do not tolerate plagiarism from our writers.
24/7 Customer Support
Clients can reach us any time of the day, and any day of the week. There is a live chat, email or phone numbers to help in ease of communication.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
You should never be worried about your papers even in the middle of the night. Our team will work round the clock to deliver.
We have an able team that can deliver your work in the shortest time possible. The academic level or the type of work should never be a hindrance. Our highly competent support team is always around (24/7) to give you any assistance you may need.
Admission Essays & Business Writing Help
Do you need to be admitted in your dream institution but find it challenging to write an admission essay? Our team is in a position to write the best letter that will guarantee you an admission. We do as well write the best business proposals and reports.
Writing can be fun and enjoyable when everything has been done right. Writing is not just enough without proper editing and proofreading. We have a team of editors that ensure everything falls in place, whether its issues to do with grammar or referencing styles.
Once the paper has been done and submitted, that is not the end of it. You can always ask for amendment or improvement if you feel something has not been done right. Our team of writers and editors will gladly assist you to your satisfaction. Revision is free of charge.