Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have to write a program which prints a calendar for a given range eg.March 2001 to August 2003.The program has to start a calendar with a given start month in a given start year and end with a given end month in a given end year. I have to use JBuilder 3.5. I dnt even know where to start! Someone, please help me. I only have 5 days left to complete this. I'd really appreciate some help. URGENT!!! Thanx

i forgot, it should also work out whether the year is a leap year. As if the calender alone wasnt enough!!

as with most people, we arent here to do your homework, if you would post what you have done we could help point you to what u need to change.

Maybe it is stupid, but here is, what I would do:
1. Make a list, what your programm should do
2. Make a list of needed classes
3. Make the gui Interface
4. Paint a picture on how your programm should work
5. Write plain Methods
6. Write the methodsIf you have errors and can not figure out were, just post the part of code and we will try to find it

I did something similar that probably uses similar code. Take a look:
public static void GregorianCalendar(String dateOutput,String timeOutput)
{
int date,minute,second,hour,year,month;
String monthName = "Smarch";
String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
SimpleTimeZone edt = new SimpleTimeZone(-5 * 60 * 60 * 1000, ids[0]);
edt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
edt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
//daylight savings times
Calendar calendar = new GregorianCalendar(edt);
date = calendar.get(Calendar.DATE);
month = calendar.get(Calendar.MONTH);
year = calendar.get(Calendar.YEAR);
hour = calendar.get(Calendar.HOUR);
minute = calendar.get(Calendar.MINUTE);
second = calendar.get(Calendar.SECOND);
switch(month)
{
case 1:
monthName = "January";
break;
case 2:
monthName = "February";
break;
case 3:
monthName = "March";
break;
case 4:
monthName = "April";
break;
case 5:
monthName = "May";
break;
case 6:
monthName = "June";
break;
case 7:
monthName = "July";
break;
case 8:
monthName = "August";
break;
case 9:
monthName = "September";
break;
case 10:
monthName = "October";
break;
case 11:
monthName = "November";
break;
case 12:
monthName = "December";
break;
}
dateOutput = monthName + " " + date + ", " + year;
timeOutput = hour + "h:" + minute + ":" + second;
} //end of GregorianCalendar

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |