Question: import java.util.Scanner; public class PrintCalenderShell { public static void main(String[] args) { Scanner kb = new Scanner(System.in); //prompt the user to enter the year boolean
import java.util.Scanner; public class PrintCalenderShell { public static void main(String[] args) { Scanner kb = new Scanner(System.in); //prompt the user to enter the year boolean repeat = true; while (repeat)//repeat as long as the user wants to { //your code } } /*this method prints the body of the calender for the given month*/ public static void printMonth(int year, int month) { //call the method printTitle with the values year and month //call the method printMonthBody with the values year and month } /*this method prints the title of the days in each week(sunday Mon Tues Wed Thur Fir Sat)*/ public static void printMonthTitle(int year, int month) { //output the title for each month of the year } /*this method outputs the calender for each month of the year*/ public static void printMonthBody(int year, int month) { //call the method getStartDay to get the start day for each month of the year //call the method print to print the calender for the month and pass the first day of the month as the parameter } /*prints the calendar for the given month*/ public static void print(int startDay, int year, int month) { // call the method getNumberOfdaysInMonth to finde out the number of the days in the month //use a for loop to print spaces up to the start day for each month //use another for loop to print the rest of the days in the calender //if the month is November calculate the thanksgiving day and output } } /*this method calculates the date for thanksgiving, you need to use a switch statment. Thanksgiving is always on fourth Thursday of November. depending on the first day of the month a constant needs to be added to 3 * 7 since we have three full weeks. if the first day of the month is on a Sunday then for that month thanksgiving will be 5 + 3 *7. */ public static int thanks(int startDay) { return 0; } /*you can use this method from you previous HW */ public static String getMonthName(int month) { return ""; } /*this method returns the atrt day of the month*/ public static int getStartDay(int year, int month) { //call the method getTotalNumberOfDays and store it in a variable called start //add 3 to the variable start //return start % 7 return 0; } /*returns the total number of the days up to the given month in the given year */ public static int getTotalNumberOfDays(int year, int month) { return 0; } /*this method return the number of the days in the given month of the given year. take leap year into consideration*/ public static int getNumberOfDaysInMonth(int year, int month) { return 0; } /*returns true if the given year is leap, false otherwise*/ public static boolean isLeapYear(int year) { //refer to the HW description return false; } } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
