CIS 162

Lab 4: Simple Time

Fall 2018

Preparation

Read Sections 5.1 through 5.8

Objectives

After completing this lab, you should be able to:

Code

Write a new class that represents the time of day:

As you complete each method, use BlueJ's object inspector to verify that your methods are correct.

When you have completed all the methods above,

Submission

When your code passes all of the unit tests

  1. Print out your code. (One printout per team.)
  2. Demonstrate to the instructor or lab assistant that your code passes all the unit tests.
  3. The instructor or lab assistant will initial your printout

Challenge Problem

Add this method public int secondsElapsed(SimpleTime start) that will calculate the number of seconds that have elapsed between start and the time represented by the current object. Add test methods to SimpleTimeTest to verify that your code is correct.