Design, write in Java, test and document a program to calculate the date following a given date. The program should first check whether the date entered is a valid date. It should take into account the leap years. The output from your program should look something like this. The user input is shown in bold.

Tomorrow’s date:
Enter the day for today’s date: 15
Enter the month for today’s date: 2
Enter the year for today’s date: 2015
Tomorrow’s date is: 16 February 2015

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 30
Enter the month for today’s date: 2
Enter the year for today’s date: 2015

***ERROR: Invalid input - this is not a legal date.

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 28
Enter the month for today’s date: 2
Enter the year for today’s date: 2015
Tomorrow’s date is: 1 March 2015

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 10
Enter the month for today’s date: 0
Enter the year for today’s date: 2015

***ERROR: Invalid input - this is not a legal date.

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 30
Enter the month for today’s date: 3
Enter the year for today’s date: 2015
Tomorrow’s date is: 31 March 2015

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 28
Enter the month for today’s date: 2
Enter the year for today’s date: 2016
Tomorrow’s date is: 29 February 2016

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 0
Enter the month for today’s date: 0
Enter the year for today’s date: 2000

***ERROR: Invalid input - this is not a legal date.

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 28
Enter the month for today’s date: 2
Enter the year for today’s date: 2100
Tomorrow’s date is: 1 March 2100

Do you wish to continue (Y/N)?
Y

Tomorrow’s date:
Enter the day for today’s date: 31
Enter the month for today’s date: 12
Enter the year for today’s date: 2015

Tomorrow’s date is: 1 January 2016

Do you wish to continue (Y/N)?
N

End of Program.

The program should print out the name of the month rather than the number as part of tomorrow’s date. The program should check for a leap year. A year is a leap year if it is divisible by 4 but not divisible by 100. For example, 2008, 2012 and 2016 are divisible by 4, but not 100. A year that is divisible by 100 is a leap year if it is also divisible by 400. For example, 1600 and 2000 are divisible by 400. However, 1900 is not a leap year because 1900 is not divisible by 400.

At the end of displaying a date, the program should ask the user if they wish to enter another date and should loop around until the user answers no.

Note that the program is not to use any library class Date. The program should be well-structured and should have a reasonable set of methods in addition to the main method. It should use a good coding style, proper indentation, meaningful identifiers and appropriate comments throughout.

The program should also include a method (eg, StudentInfo( )) to output your student details (name, student number, mode of enrolment (i.e., internal or external), tutor name, tutorial attendance day and time) at the start of program results. Note that the question does not require you to define a separate class for the Date record and a separate client program. However you are welcome to do so if you wish. Devise suitable test data to test all sections of program code. The test data together with test results should be submitted as part of your external documentation.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.