I'm working on a date class project. The user has 3 options to input the data.
a) MM/DD/YYYY
b) Month DD,YYYY (June 27, 2000)
c) DDD/YYYY (180 2014) - Days of the year
The ouput will be in all 3 formats. I'm beginner. I got stuck and have no ideas how to start the program. I think we may need a constructor for each format.
a) int mm, int dd, int yyyy
b) string month, in dd, in yyyy
c) int ddd, int yyyy
And we can use switch
for the input. Also, we need to check for the leapYear. The hard part is I do not know how to convert from this form to others.
Here what I got so far:
public class Implementation
{
private int day;
private int month;
private int year;
private final String monthNames[] = {"Jannuary", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
private final int monthDays[] = {31,28,31,30,31,30,31,31,30,31,30,31};
Can someone please help me? I'm very frustrated for this.