Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java class, Monthcalendar, that prompts the user to enter a year and month, and then, using a loop, displays a calendar for that
Write a Java class, Monthcalendar, that prompts the user to enter a year and month, and then, using a loop, displays a calendar for that month exactly as shown below Enter year and month: 2018 1 January 2018 Sun Mon Tue Wed Thu Fri Sat 1 2 34 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 Your program should figure out what day the 1st of that month is by using the Java Calendar class in the java.util package) as follows (assume input is 2018 1): Calendar cal-Calendar.getInstance(); cal.set (2018, e, 1); //Note that January is e, not 1 for this method int day - cal.get(Calendar.DAY_OF_WEEK)) //1-7, with 1 being Sunday, etc
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started