Write a Java program that is able to receive input in a particular given date pattern. The program will then parse
the input and print the requested output.
1. The first command line argument to the program is the input, provided by the user.
2. The second command line argument to the program is the date format/pattern, provided by the user.
Patterns can be provided using two ways:
1. Valid date patterns are specified here. See the Examples section of the above link for more info.
2. If a pattern begins with the letter “*”, convert and print the current time/date based on the Shamsi
Program will then display the following values individually on the command prompt using the following format:
Month Name: <name-of-the-month>
Day Name: <day-name>
Day of year: <what of the day of the year is this?
> Hour: <hour>
The following exceptions should be thrown and caught by the program internally:
WayTooOldYearException: If the input year is less than 1900
PastUserBedTimeException: If the input time is greater than 10:55pm.
All other error conditions need to be accounted for and appropriate error messages must be displayed.
Use OOP principals effectively, using the following rules:
1. Your program must contain a Main class that hosts the main() method.
2. You should provide different implementations and extensions of the public interface
IDateTimeFormatter, which includes the following and only method in its body:
DateTimeObject parseDateTime(final String value);
3. The DateTimeObject is a class that encapsulates the parsed input value in itself, and exposes various
methods for accessing the input year, month, hour, etc.
How is the program coding progressing? Do you have any specific problems or questions about your code? Please post the code (in code tags) and your questions.
hmmm, i need some hint
i don't have any idea
or do you have any code like this question that can help me
The assignment gives you ideas about how to define the classes.
Start with the Main class and the DateTimeObject class.
can you tell me if this link can help me or not ?
Is it like my question?
Day for the given Date in Java
Sorry, I'll let you look and decide. I won't help you copy someone else's code.
If you have questions about your code, copy the code here and ask your questions about your problems.
I don't want to copy someone else code.
If i want do this, why should i ask about hint.
I just want to know if this code can give me that hint or not.
thanks for your honesty
If you have questions about your code, post the code and the questions.