Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Netbeans Q1 (60 marks): Create two arrays as defined below that contain the information on the months of the year: months = {January,

image text in transcribed

In Java Netbeans

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", "une", "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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions