A Note on Positioning the Dart Board
The current description of the DartBoard class does not explicitly
state assumptions about the position of the board. This means that
you either need to make assumptions about where the board should be
drawn or you need to modify the class to include the position.
Making an assumption about the position:
There are two reasonable assumptions about position that come to
mind.
- Assume the board is positioned with the upper left corner at
(0,0), the upper left corner of the applet.
- Assume the board is positioned in the center of some fixed
size applet. In this case you should make the width and height
of the assumed applet constants in your class.
Adding location variables to the class:
In this case you need to do the following:
- Add two instance variables to the class representing
the x and y coordinate of the upper left corner of the dart board.
(You could instead make them the center of the dart board if you wish.)
- Add a constructor with 4 parameters - the current 2 (the
size of the board and the interval for the rings) plus 2 for the
position (upper left corner). NOTE: You can keep the original
constructor and it can set the position to some default value
(based on your assumptions listed above).
You may choose either of these BUT you must CLEARLY
DOCUMENT what assumptions you are making.