Creating a Class for Dates Create a class called Date212 to represent a date. It will store the year, month and day as integers so you will need three private instance variables. One constructor should be provided that takes a String representing the date in yyyymmdd format. The constructor should use the substring method of class String to pull out the month, day and year, parse them as integers put them in the instance variables. The Date212 class should have the usual set and get methods, and equals, compareTo and toString methods. The toString method should print the date in “mm dd, yyyy” format (for example, 20211002 would be returned as “October 2, 2021”. Sorting an Array of Dates/ Displaying in a GUI Given an input file of dates represented as Strings, read the dates from the file and display them in a GUI. The dates will be in the form yyyymmdd (such as 20211001 for October 1, 2021). The GUI should have a GridLayout with one row and two columns. The left column should display the dates in the format read from the file, and the right column should display the dates as Date212 object in sorted order (using Selection Sort). The input file Each line of the input file may contain several dates separated by commas. You will need to use a StringTokenizer to separate out the individual dates. So, an example of the input file would be: 20141001 20080912,20131120,19980927 20210202 20200104 Submitting the Project. You should now have the following files to submit for this project: Project1.java Date212.java DateGUI.java

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Creating a Class for Dates
Create a class called Date212 to represent a date. It will store the year, month and day as integers so
you will need three private instance variables. One constructor should be provided that takes a String
representing the date in yyyymmdd format. The constructor should use the substring method of class
String to pull out the month, day and year, parse them as integers put them in the instance variables.
The Date212 class should have the usual set and get methods, and equals, compareTo and
toString methods. The toString method should print the date in “mm dd, yyyy” format (for example,
20211002 would be returned as “October 2, 2021”.
Sorting an Array of Dates/ Displaying in a GUI
Given an input file of dates represented as Strings, read the dates from the file and display them in a
GUI. The dates will be in the form yyyymmdd (such as 20211001 for October 1, 2021). The GUI should
have a GridLayout with one row and two columns. The left column should display the dates in the
format read from the file, and the right column should display the dates as Date212 object in sorted
order (using Selection Sort).
The input file
Each line of the input file may contain several dates separated by commas. You will need to use a
StringTokenizer to separate out the individual dates. So, an example of the input file would be:
20141001
20080912,20131120,19980927
20210202
20200104
Submitting the Project.
You should now have the following files to submit for this project:
Project1.java
Date212.java
DateGUI.java

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY