Question: Using java, write the following code NOTE: put all the code in public static void main only. Do not use arrays, try to use if
Using java, write the following code
NOTE: put all the code in public static void main only. Do not use arrays, try to use if else statements in loops or switch statements. check for correct month input (1-12), year input (1800-2200), and day of the week input .

This program will print a calendar for a given month. The user will input the following: - The month (1 to 12) The year (1800 to 2200) The day of the week (0 Sunday, 1 - Monday, etc.) that the 1st falls on. Use the validation code you wrote in #1 to validate the input. Name your project Calendar and create a source file called Calendaf.java. The calendar will look like this: OCTOBER 2018 S M T W T F S 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 One algorithm to print this would be to a) First print the name of the month, then the Day headers b) On the next line, print spaces for days leading up to the first of the month. c) Print the current day of the month, increment the day of the month. d) If we've printed the last day of the week (Saturday, day 6), print a new line e) If we've printed the last day of the month, print a new line and exit the loop. f) Loop back to step c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
