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

Problem: Write a complete program that takes a string (6/12) representing the mo

ID: 3645230 • Letter: P

Question

Problem: Write a complete program that takes a string (6/12) representing the month, and day.
Then your program outputs the season and the name of the month for the given date. 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.

Requirements:
1. Must prompt the user for input for as many times as the user wants.
2. Must break down your program to different methods. Minimum you need to have two
different methods. One that returns the season for the given month and one that returns
the name of the month.
3. Must read the date as a string; use the methods from the String class to pull out the month
and the day as integers.
4. You must use conditional statements and loops
5. Convert a string to an integer value use the Integer class. Here is an example:
int num = Integer.parseInt(

Explanation / Answer

Here is the code: import java.util.Calendar; public class DayYearToDayMonth { public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, 2007); calendar.set(Calendar.DAY_OF_YEAR, 181); System.out.println(" The date of Calendar is: " + calendar.getTime()); int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH); System.out.println("The day of month: " + dayOfMonth); int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); System.out.println("The day of week: " + dayOfWeek); } }

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