Java OOP GUIDE / WORK DURATION CLASS Topics
TASK –
PART 1 – DURATION CLASS You
will create a Duration class which will hold the duration of something like a
movie or a song. Here are the
specifications:
|
TASK – PART 2 – TESTING
THE DURATION CLASS Create a DurationTester
class. Create three Duration objects
each using a different constructor.
Make sure to test the instance methods. TASK – PART 3 – SHORT
ANSWER QUESTIONS a)
Constructor
#2 (and Constructor #3) can be accidentally misused. Can you predict how a programmer might make
an error? b)
The
method getTotalSeconds() requires a calculation that
might be challenging for some. How
would you test it to make sure that is working correctly like it is intended
to be? |