Question
Create your own Date class (not the existing Java API Date class) that can output the date in multiple formats. You may assume that the
Create your own Date class (not the existing Java API Date class) that can output the date in multiple formats. You may assume that the user enters the data correctly and that there is not a leap year. Output the date entered by the user in all three of the following formats (with today's date as an example):
MM/DD/YYYY (01/26/2021)
Month name, DD, YYYY (January 26, 2021)
DDD YYYY (026 2021)
Use overloaded constructors to create Date objects initialized with dates of the formats and content enters by the user. There should be a default constructor, the second constructor should receive three integer values, the third a string and two integers, the fourth two integers.
The user should get a menu of options to enter the date in any one of the three formats. Then the program will convert that entry and display all three formats with a well formatted output to the display. The program should loop continually until the user is done entering dates and chooses to exit.
Your files should include the Date class and a DateTest class which contains the code to test your class functions. Also, your submission files should include execution screenshots showing that all options are working correctly. All code should include a comment header with your name, section number, and a description of the program.
Grading criteria are listed in the associated rubric. Two attempts for submission are allowed to provide an opportunity to ensure all files are included. All code must be executable and your own original work. Code is subject to the same academic integrity guidelines and reporting as other types of assignments and projects.
Sample output would look as follows:
This program converts dates entered to multiple formats.
Enter your date in the format you choose and all three formats will be provided as an output.
Enter 1 for format: MM/DD/YYYY
Enter 2 for format: Month DD, YYYY
Enter 3 for format: DDD YYYY
Enter 4 to exit
Choice: 1
Enter Month (1-12): 5
Enter Day of Month: 12
Enter Year: 2021
MM/DD/YYYY: 5/12/2021
Month DD, YYYY: May 12, 2021
DDD YYYY: 132 2021
Enter 1 for format: MM/DD/YYYY
Enter 2 for format: Month DD, YYYY
Enter 3 for format: DDD YYYY
Enter 4 to exit
Choice: 2
Enter Month Name: May
Enter Day of Month: 12
Enter Year: 2021
MM/DD/YYYY: 5/12/2021
Month DD, YYYY: May 12, 2021
DDD YYYY: 132 2021
Enter 1 for format: MM/DD/YYYY
Enter 2 for format: Month DD, YYYY
Enter 3 for format: DDD YYYY
Enter 4 to exit
Choice: 3
Enter Day of Year: 132
Enter Year: 2021
MM/DD/YYYY: 5/12/2021
Month DD, YYYY: May 12, 2021
DDD YYYY: 132 2021
Enter 1 for format: MM/DD/YYYY
Enter 2 for format: Month DD, YYYY
Enter 3 for format: DDD YYYY
Enter 4 to exit
Choice: 4
Thank you for using my program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started