(Date and Time Class) Create class DateAndTime that combines the modified Time2 class of Exercise and the modified Date class of Exercise. Modify method incrementHour to call method nextDay if the time is incremented into the next day. Modify methods toString and toUni-versalString to output the date in addition to the time. Write a program to test the new class Da-teAndTime. Specifically, test incrementing the time to the next day.
Exercise
(Enhancing Class Time2) Modify class Time2 of Fig. to include a tick method that increments the time stored in a Time2 object by one second. Provide method incrementMinute to increment the minute by one and method incrementHour to increment the hour by one. The Time2 object should always remain in a consistent state. Write a program that tests the tick method, the incrementMinute method and the incrementHour method to ensure that they work correctly. Be sure to test the following cases:
a) incrementing into the next minute,
b) incrementing into the next hour and
c) incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
Fig. | Time 2 class with overloaded constructors.



Exercise
(Enhancing Class Date) Modify class Date of Fig. to perform error checking on the initializer values for instance variables month, day and year (currently it validates only the month and day). Provide a method nextDay to increment the day by one. The Date object should remain in a consistent state. Write a program that tests method nextDay in a loop that prints the date during each iteration to illustrate that the method works correctly. Test the following cases:
a) incrementing into the next month and
b) incrementing into the next year.
Fig. | Date class declaration.


We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.