[SOLVED] INFO5100 Assignment 6

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment6-kzdgyo.zip (27.2 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Homework 6

Question 1

For the class,

public class Student { private int id;

private String name; private double gpa; private Date dateOfBirth;

}

Write Custom Sorting by implementing the following comparators
  1. NameComparator: Student objects should be sorted in ascending order by ‘name’ field of the object;
  2. GpaComparator: Student objects should be sorted in descending order by ‘gpa’ field of the object;
  3. DateOfBirthComparator: Student objects should be sorted in ascending order by ‘dateOfBirth’ field of the object;
Then in the main method, create a List of Student objects and print the list of
objects 3 times with the following logic.

1. Sort by ascending order of ‘name’
2. Sort by descending order of ‘gpa’
3. Sort by ascending order of ‘dateOfBirth’

Question 2

Write a class called 'DrivingLicenseApplication' to read input from the keyboard which
take dateOfBirth of Date datatype. If the age is below 16 (For example 14), then throw
and catch and exception which prints the message.
The age of the applicant is 14 which is too early to apply for a driving license
  • Assignment6-kzdgyo.zip