Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create a java class hierarchy which has an abstract class called DateList (th

ID: 3566505 • Letter: 1

Question

1. Create a java class hierarchy which has an abstract class called DateList (the same class as in
project 2 but it is abstract). This class should have two subclasses: UnsortedDateList and
SortedDateList, each having a method called add. In the UnsortedDateList the method add will
add to the end of the list (append), and in the SortedDateList it will do an insert. So now, rather
than in project 2 where you used two of the same kind of list (DateList) you will use one
unsorted list and one sorted list.
2. Create a new exception called IllegalDate212Exception by extending lllegalArgumentException.
3. When you create a new Date212 from a String read from the input file, catch any exceptions
thrown by the constructor and print the offending string to the console along with the message
from the Exception.
4. Add a File menu to your GUI which has menu items for Open and Quit. You should now be able
to select an input file using the GUI.
The format of the input file will be the same as Project 1.
Submitting the Project.
You should now have at least the following files to submit for this project:
Project3.java
Date212.java
DateGUI.java
DateNode.java
DateList.java
UnsortedDateList.java
SortedDateList.java
FileMenuHandler.java

Input file:

20141001
20131103
19990205
20080304,20080305,20080306
19990206,hello,20141001,200003
20050505
October
November,December
19640503
19980703
19642199
20141013

Explanation / Answer

import java.io.*; import java.util.*; public class Task { private BufferedReader input; private PrintWriter output; private StringTokenizer stoken; String fin = "input"; String fout = "output"; private void solve() { // some solving code... int n = nextInt(); int[] mas = new int[n]; for (int i = 0; i