How to make a calender in JAVA that can take a date format and then display the corresponding just like a normal calender date in graphical mode. the code shold not contain any predefined API. Please help me any one by just saying the algorithm. And the the design steps....
The OP probably means that existing APIs that provide calendar and date functions can't be used.
Here's a rough outline of what must be done:
Hopefully, there's a reasonable bound to the problem; beginning and end dates for which your program must work. I'll assume so.
1. Get a date from the user (month/year).
2. Check that the date is valid: between the upper and lower bounds, a real month/year, etc.
3. Determine the starting day for the user's month and year.
a. Based on knowledge of one day within the bounded dates
b. Determine the leap years between known date and user date
c. Calculate the starting day of the user's month.
4. Determine the number of days in the user's month
5. Using result of 3 and 4, print the user's month/year.
a. Typical format:
S M T W T F S
(skip the number of days before the correct start date, then print the dates.)
5. Continue until the user is done.
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795