![]() |
.. (לתיקייה המכילה) | |
Can we add classes which are not mentioned in the specification to our implementation ?
| Yes. But, as mentioned in the homework document, these classes should not affect the protocol of the Counter class |
(a) Do I need to document my code?
(b) Do I need to include in my source code the Javadoc comments of the specification you published?
|
(a) No (b) No |
Why don't you want us to document our code?
|
I want your code to be simple and undetstandable. If you rely on the documentation to help me understand the code, then either the code is too complicated, or the names of the fields/classes/methods do not properly describe their role. |
Is it possible for a programmer to define new instances of the Formatter class?
| No. He is only allowed to use the predefined instances FORMATTER_A ... FORMATTER_O |
Regarding formatters M and N: What happens if they are invoked on a root counter (a counter which has no parent)?
|
The specs do not talk cover this point. The correct output (for a root counter, c) is: Integer.toString(c.get()) |
In the non default constructor documentation it is written "The
formatter object of the parent is set as the formatter of the child". Shouldn't
it be "The formatter object of the CHILD is set as the formatter of the
PARENT"?
| Well, it depends on how you read it. Anyway, what I meant is: child.formatter = parent.formatter; |
In FORMATTER_I, is there a mistake in the example code? The example output is
[1.2], shouldn't it be [2.1] instead?
| Yes, you are right. |

