write a java program that ask user for input and produce output like January 31, 2023. that accept any integer between 1 and 12 as first input, any integer between 1 and 31 as the second input, and any integer between 1 and 99 as the theird input. The inputted numbers must be inside the eligible ranges. E.g., if the user inputs 15 as the first number, the program must generate the corresponding error message. The number of eligible days must depend on the month. E.g., the second input of 31 is not eligible if the first input was 4 (April). If the inputted year is a leap, the number of eligible days in February must be 29.  instead of stopping after the wrong input, your program must request the new input until the correct one is provided. the execution should look like this: Enter a month from 1 to 12: 2 Enter a day from 1 to 29: 12 Enter a year from 1 to 99: 10 February 12, 2010. More? (Y/N) Y Enter a month from 1 to 12: 1 Enter a day from 1 to 31: 1 Enter a year from 1 to 99: 0 Invalid year. Enter a year from 1 to 99: 1 January 1, 2001. More? (Y/N) Y Enter a month from 1 to 12: 31 Invalid month. Enter a month from 1 to 12: 2 Enter a day from 1 to 29: 29 * We will check for a leap year in the next step * Enter a year from 1 to 99: 23 Not a leap year. So, enter a new day from 1 to 28: 28 February 28, 2023. More? (Y/N) N

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

write a java program that ask user for input and produce output like January 31, 2023.

that accept any integer between 1 and 12 as first input, any integer between 1 and 31 as the second input, and any integer between 1 and 99 as the theird input.

The inputted numbers must be inside the eligible ranges. E.g., if the user inputs 15 as the first number, the
program must generate the corresponding error message.


The number of eligible days must depend on the month. E.g., the second input of 31 is not eligible if the first input was 4 (April).


If the inputted year is a leap, the number of eligible days in February must be 29. 

instead of stopping after the wrong input, your program must request the new input until the correct one is provided.

the execution should look like this:

Enter a month from 1 to 12: 2
Enter a day from 1 to 29: 12
Enter a year from 1 to 99: 10
February 12, 2010.
More? (Y/N) Y
Enter a month from 1 to 12: 1
Enter a day from 1 to 31: 1
Enter a year from 1 to 99: 0
Invalid year. Enter a year from 1 to 99: 1
January 1, 2001.
More? (Y/N) Y
Enter a month from 1 to 12: 31
Invalid month. Enter a month from 1 to 12: 2
Enter a day from 1 to 29: 29
* We will check for a leap year in the next step *
Enter a year from 1 to 99: 23
Not a leap year. So, enter a new day from 1 to 28: 28
February 28, 2023.
More? (Y/N) N
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education