Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java don't use switch statements and please provide detailed steps Q1 (60 marks): Create two arrays as defined below that contain the information on the

image text in transcribed

Java don't use switch statements and please provide detailed steps

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 December

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

Does your message use pretentious or exaggerated language?

Answered: 1 week ago

Question

What is the growth rate of GDP per capita?

Answered: 1 week ago