1. Log in to UH UNIX (Secure Shell in Windows)
or (Putty)
and create a Java application that fulfills the following requirements:
- The students will create a class Clock.java. It will require no main
method. It should have the following instance variables:
- int iTimeHour
- int iTimeMinute
- char cAMPM //a for AM, p for pm
- boolean isDigital //true if it is digital, false otherwise
- There should be two constructors:
1. Constructor that takes all four parameters in the order (hour, minute,
cAMPM, isDigital)
2. Constructor that takes the parameter isDigital only and automatically
assigns time hour = 12, minute = 00, cAMPM = p.
- Write a toString method
- Write all the set Methods (setHour, setMinute, setAMPM,
setIsDigital)
- Write all the get Methods (getHour, getMinute, getAMPM,
getIsDigital)
- Write an equals Method that will compare all the parameters.
- This program will be tested with Matt's program that will create a Clock
object and modify it. If you want to test your Clock class you should
create your own ClockTester.java class. You should NOT submit your tester
class because it will not be used. Matt's class will be used.
You need to write comments using
the
JAVA coding standard - failure to do so will result
in up to a 30% deduction from your score.
2. Open Pine (Getting
Started with Pine, PDF) and send an email with the file attached to ics111-lab@hawaii.edu account.
- Your e-mail should have the following subject: lab X / lastname (substitute
the lab number for 'X', and lastname should be substituted for your lastname) Not following this standard will result in a deduction
of points.
- SEND YOUR .JAVA FILE (ATTACHED) TO THE EMAIL. REMEMBER, SUBMIT
ONLY THE CLOCK CLASS, PLEASE DON'T SUBMIT YOUR CLOCK TESTER CLASS.
3. Check the webpage to make sure that the e-mail arrived at
http://www2.hawaii.edu/~tp_200/bmf/ics111-lab.html
For
grading policies on your lab, click here...