Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a method, season, that takes two integers as parameters representing a mon

ID: 665601 • Letter: W

Question

Write a method, season, that takes two integers as parameters representing a month and day and that returns a String indicating the season for that month and day. Assume that months are specified as an integer between 1 and 12 (1 for January, 2 for February, and so on) and that the day of the month is a number between 1 and 31. You should check that the inputs are within these bounds, but you are riot required to check for invalid month, day combinations such as month=2 and day=30. For dates between 16 December and 15 March, return Summer. For dates between 16 March and 15 June, return Autumn. For dates between 16 June and 15 September, return Winter. For dates between 16 September and 15 December, return Spring. 3a) Complete the table on the next page by adding five (5) new test cases to check the correctness of an implementation of this method. The first line (in italics) is given as an example. The Rationale column should contain a brief comment for each test case to justify your choice. 3b) Write Java code to implement the season method.

Explanation / Answer

IMPORTING end_date = l_date. IF l_date(4) GT 2020. EXIT. ENDIF. PERFORM get_season USING l_date CHANGING l_season. WRITE: 'The season on', l_date , 'is' , l_season. NEW-LINE. ENDDO. *&---------------------------------------------------------------------* *& Form get_seasons *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->DATE text * -->SEASON text *----------------------------------------------------------------------* FORM get_season USING p_date TYPE sydatum CHANGING p_season TYPE string. IF p_date+4 LT '0321'. l_season = 'Winter'. ELSEIF p_date+4 LT '0621'. l_season = 'Spring'. ELSEIF p_date+4 LT '0921'. l_season = 'Summer'. ELSEIF p_date+4 LT '1221'. l_season = 'Fall'. ELSE. l_season = 'Winter'. ENDIF. ENDFORM. "get_season

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote