Zookal
Zookal

We’d love to hear any feedback or comment from you!

© 2011-2021 Zookal Pty Ltd

View question and answer

From our collection of questions and answers
Engineering · Computer Science
Question details

Java Programming

20 marks] Implement a Java method that prints out the day of the week for a given day (1...31), month (1.. . 12) and year in the range of March 1900 to February 2100. Calculate the day of the week for the dates between March 1900 and February 2100 as follows: First, you have to calculate the total number of days from 1900/1/1 to the given date (see below for details) Secondly, you divide this number by 7 with an integer remainder: This now is the day of the week, with 0 as Sunday, 1 as Monday, and so on. To calculate the total number of days, you have to implement the following steps: Subtract 1900 from the given year, and multiply the result by 365 Add the missing leap years by adding (year - 1900)/ 4.. If the year itself is a leap year and the month is January or February, you have to subtract 1 from the previous result. Now add all the days of the months of the given year to the result (in the case of February, it is always 28 because the additional day for a leap year has already been added in the calculation) WeekDay E Attributes + private int numberOfDays + public static final int APRIL public static final int AUGUST + public static final int DECEMBER + public static final int FEBRUARY + public static final int FRIDAY + public static final int JANUARY + public static final int JULY + public static final int JUNE + public static final int MARCH + public static final int MAY + public static final int MONDAY + public static final int NOVEMBER + public static final int OCTOBER + public static final int SATURDAY + public static final int SEPTEMBER + public static final int SUNDAY + public static final int THURSDAY + public static final int TUESDAY + public static final int WEDNESDAY E Operations + public String getWeekDay (int day, int month, int year)

Answer
Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.

Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.Find step-by-step answers from expert tutors to questions asked by students like you. Start 14-day free trial.