CSE1030Z Lab 06

Practice Lab Test

Wed Feb 13 2:30-4:00 PM

Introduction

This lab tests your knowledge of the following intended learning outcomes:

Note that there are many intended learning outcomes that are not covered by this lab!

This is a practice lab test. You must submit before the computers reboot at the end of the lab.

Question 1: Implement a class that represents time on a 12-hour clock

Implement the class SimpleTime so that it provides the following API:

Some code to start your solution can be found here:

Here is a check list of items that your solution must provide:

  1. SimpleTime()
  2. SimpleTime(SimpleTime other)
  3. SimpleTime(int hour, int minute, boolean am)
  4. Javadoc for the constructor SimpleTime(int hour, int minute, boolean am)
  5. getHour()
  6. setHour(int hour)
  7. getMinute()
  8. setMinute(int minute)
  9. compareTo(SimpleTime other)

Submit your solution:

submit 1030Z L6W SimpleTime.java

Question 2: Implement a class that represents an alarm clock

Implement the class AlarmClock so that it provides the following API:

Some code to start your solution can be found here:

Here is a check list of items that your solution must provide:

  1. an attribute to hold the clock time
  2. an attribute to hold the alarm time
  3. AlarmClock(SimpleTime clockTime, SimpleTime alarmTime)
  4. getClock()
  5. setClock(SimpleTime newTime)
  6. getAlarm()
  7. setAlarm(SimpleTime newTime)

Submit your solution:

submit 1030Z L6W AlarmClock.java