Java OOP GUIDE / WORK LATESLIP CLASS Topics
TASK –
PART 1 – LATESLIP CLASS: INSTANCE VARIABLES You
will create and test a LateSlip class that
represents a typical late slip from the office. Your
class should have the following instance variables. |
||
TASK –
PART 2 – LATESLIP CLASS: CONSTRUCTORS The class
should have two constructors. One
constructor should get a value for each of the instance variables. The other
constructor should get a value for the first five instance variables (not
detention) and simply set detention to false.
TASK –
PART 3 – LATESLIP CLASS: METHODS Create
get methods for all instance variables (6 methods). Create
a addDetention() method that sets the detention
instance variable to true.
TASK –
PART 4 – TESTING In the main
of a Tester class, give yourself a lateslip from
the vice principal. Output it to
screen. Also in the
main, create another late slip that initially has no detention. Output it to screen. Then use the addDetention() method and
re-output it to screen to see how the slip is different. |