Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java and please explain each step Q1 (60 marks): Create two arrays as defined below that contain the information on the months of the year:
java and please explain each step
Q1 (60 marks): Create two arrays as defined below that contain the information on the months of the year: months = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} daysOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} Note that the number of days of a month x is saved in same index of x in the array daysOfMonth. a. In your main, create a program that asks the user for two integer values between 1 and 12, inclusive. Using the arrays, your program should print out the name of the months and number of days in them corresponding to the numbers the user entered. Your program must REJECT any numbers that's outside this range. b. On a new line, print which month comes before the other. An example printed output for Q1 could be: "Please enter two numbers: 12 3 The months you chose are December which is has 31 days, and March which has 31 days. March comes before DecemberStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started