Question: Write a program that prompts the user to enter a year and the first three letters of a month name (with the first letter in

Write a program that prompts the user to enter a year and the first three letters of a month name (with the first letter in uppercase) and displays the number of days in the month. Here is a sample run:Enter a year: 2001 Enter a month: Jan Jan 2001 has 31days JEnter JEnter Enter a year: 2016 Enter a month: Feb Jan

Enter a year: 2001 Enter a month: Jan Jan 2001 has 31 days JEnter JEnter Enter a year: 2016 Enter a month: Feb Jan 2016 has 29 days JEnter JEnter

Step by Step Solution

3.35 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program Plan Create a class called DaysOfMonth Initialize the main method with variable year days as integer and month as string Create a Scanner clas... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!