Question: in java ( Enhancing Class Date ) Modify class Date of Fig. 8 . 7 to perform error checking on the initializer values for variables
in java
Enhancing Class Date Modify class Date of Fig. to perform error checking on the
initializer values for variables month, day and year currently it validates only the month
and day Provide a method nextDay to increment the day by one. 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.
Enhancing Class Time Modify class Time of Fig. to include a tick method that
increments the time stored in a Time object by one second. Provide method
incrementMinute to increment the minute by one and method incrementHour to
increment the hour by one. 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 ie:: PM to :: AM
Date and Time Class Create class DateAndTime that combines the modified Time
class and the modified Date class of the previous question Modify method
incrementHour to call method nextDay if the time is incremented into the next day.
Modify methods toString and toUniversalString to output the date in addition to
the time. Write a program to test the new class DateAndTime. Specifically, test
incrementing the time to the next day.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
