If the diver is wet, then all the attributes are relevant. If the diver is dry, then their depth is 0, and their tank capacity is irrelevant (the values of this attribute can be ignored). If the diver is bent, then their tank capacity is irrelevant, but their depth is kept on record, to help medical staff treat them.
Diver
, which we've begun.
We've also provided a second class, TestDiver
that
demonstrates how the methods in Diver
are called.
Do not make any changes to
TestDiver
, nor any of the methods or variables in
Diver
that we have provided. This
intentionally constrains your design choices.
TestDiver
contains a
main
method that makes use of class
Diver
.
Assignment2
and
include the two .java
files. Be sure to set the
CodeWarrior Target Settings so that TestDiver
is
the main class.
Diver.java
. Finish it. We have provided the
provided method comments for some methods you need to write.
It's like a jigsaw puzzle: you can figure out what those five
methods should be called and what their parameters are by
looking at what happens in TestDiver
and by
carefully reading the method comments. You also need to figure
out the last instance variable (there's a comment for that too).
Diver.java
file electronically for
marking. You don't need to submit
TestDiver.java
, since it hasn't been changed.
You also don't need to submit any project files or
.class
files. Reread the rules for assignment
submission to be certain you've followed them.