Writing a Modular Program in Java
In this lab, you add the input and output statements to a partiallycompleted Java program. When completed, the usershould be able to enter a year, a month, and a day to determine ifthe date is valid. Valid years are those that are greater than 0,valid months include the values 1 through 12, and valid daysinclude the values 1 through 31.
Instructions
- Notice that variables have been declared for you.
- Write the simulated housekeeping() method that contains inputstatements to retrieve a year, amonth, and a day from theuser.
- Add statements to the simulated housekeeping() method thatconvert the String representation of the year,month, and day to ints.
- Include the output statements in the simulated endOfJob()method. The format of the output is as follows:
month/day/year is a valid date.ormonth/day/year is an invalid date.
- Execute the program entering the following date:
month = 5, day = 32, year =2014
Observe the output of this program. - Execute the program entering the following date:
month = 9, day = 21, year = 2002
Observe the output of this program.