Question
simple Java program that takes and validates a date. The program must convert three integer numbers inputted by the user into a date of the
simple Java program that takes and validates a date.
The program must convert three integer numbers inputted by the user into a date of the 21st century. For example, if the user inputs 2, 2, and 22, the program must output "February 2, 2022."
the first version must have at least the header information and be able to ask the user for input, accept the input, and produce output. For the first version, you may assume that the user is interested in only one date, say "01/01/2022," and no input error is possible. Then your program must output "January 1, 2022" if the user inputs 1, 1, and 22.
the second version must accept any integer between 1 and 12 as the first input, any integer between 1 and 31 as the second input, and any integer between 1 and 99 as the third input. No error check is required in this version. if the user inputs 2, 31, 22, the program outputs "February 31, 2022."
The third version must check inputs for correctness:
(a) The inputted numbers must be inside the eligible ranges. E.g., if the user inputs 15 as the first number, the program must stop with the corresponding error message.
(b) 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).
(c) If the inputted year is lean, the number of eligible days in February must be 29. Feel free to use
Step by Step Solution
3.36 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
Here is a simple Java program that takes and validates a date based on the requirements you provided ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started