Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to display calendar

807589Jun 23 2008 — edited Jun 23 2008
So I've been working on this problem but i am stuck in the formating of the days integers for each calendar month

here is the problem

Displaying calendars (filename: DisplayCalendars.java)

Design an algorithm and then write a Java program that prompts the user to enter the year and first day of the year, and displays the calendar table for the year on the console. For example, if the user entered the year 2005, and 6 for Saturday, January 1, 2005, your program should display the calendar for the 12 months in the year, as follows:
January  2005
___________________________________________
Sun	Mon	Tue	Wed	Thu	Fri	Sat
1	 
2	 3	 4	 5	 6	 7	 8	 
9	 10	11	12	13	14	15	
16	17	18	19	20	21	22	
23	24	25	26	27	28	29	
30	31	

February  2005
____________________________________________
Sun	Mon	Tue	Wed	Thu	Fri	Sat
1	 2	 3	 4	 5	 
6	 7	 8	 9	 10	11	12	
13	14	15	16	17	18	19	
20	21	22	23	24	25	26	
27	28	
Can anyone please help me
I need to display this on the console (ie.system.out.print...)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2008
Added on Jun 23 2008
4 comments
2,223 views