Question: This code should be done in Java thank you. 1. Create a program called Date.java with all kinds of overloaded constructors. In addition, have the

This code should be done in Java thank you.

1. Create a program called Date.java with all kinds of overloaded constructors. In addition, have the set() mutator method to perform error-checking on the properties month, day, and year.

Also, provide a method increaseByOneDay() to increment the day by one. Write a program called DateTest.java and have the increaseByOneDay() method tested in a loop of at least 100 iterations .

Test the following cases: a. Incrementing into the next month b. Incrementing into the next year Sample Program Output: Checking increment Date object constructor for date 11/27/2011 Incremented Date:11/28/2011 Incremented Date:11/29/2011 Incremented Date:11/30/2011 Day 31 invalid. Set to day 1. Incremented Date:12/1/2011 Incremented Date:12/2/2011 ... Incremented Date:12/30/2011 Incremented Date:12/31/2011 Day 32 invalid. Set to day 1. Incremented Date:1/1/2012 Incremented Date:1/2/2012 Incremented Date:1/3/2012 Incremented Date:1/4/2012 Incremented Date:1/5/2012 Incremented Date:1/6/2012

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!