Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

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
Check Mark
Knowledge Booster
Background pattern image
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
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education