:السلام عليكم
Modify the class Time2 given above to include the following methods:
1- A tick method that increments the time stored in a Time2 object by one second:
public void tick()
2- A method that increments the time stored in a Time2 object by one minute:
public void incrementMinute()
3- A method that increments the time stored in a Time2 object by one hour:
public void incrementHour()
4- A method that increments the time stored in a Time2 object by a given number of seconds:
public void incrementSecondsBy(int number)
هاذا الجزء الاول من السؤال
The Time2 object should always remain in a consistent state. Write a program that tests the tick method,
the incrementMinute method, 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).
هاذا الجز الثاني من السؤال