I spent a good part of Saturday and Sunday struggling with Questions 2 and 3 of TMA01, because the code I’d written for the
Coder classes just would not produce the correct output, no matter what I did. I was mystified, because not only was the code producing inappropriate output – which obviously could have been due to my poor programming – it was producing output that didn’t seem to reflect any of the changes I’d made to the code.
So, if the original code had
System.out.println("Here is a test line");
and I amended it to
System.out.println("Here is a test line, and if it doesn't appear in the output window I will throw my laptop through the actual window");
then saved the class file, I would still get the original version outputted the next time I compiled and ran the
Which, as it turns out, is to be expected – because I wasn’t re-compiling
Guesser, just the classes containing the test code. *facepalm*
Once I’d figured out that the Compile Package keyboard shortcut was my new best friend, the rest of the TMA01 was pretty straightforward. My tutor did say in his introductory letter that the first TMA would be an easy one, but I’m still surprised at how little the wording of the questions leaves to the student’s discretion. There’s lots of hand-holding, lots of very specific instructions. Which is good in the sense that we get an opportunity to practice the techniques we’ve learned, without worrying much about which technique in particular to use, but it does also take some of the fun out of the process. I’m sure the other two TMAs will be more challenging – particularly as the next one covers the unit on GUIs, which I’ve got absolutely no experience of in Java.
So, now that TMA01 is finished and zipped up ready for submission, I just need to set up my Update Scanner extension to scan the M257 TMA Downloads page every day until TMA02 is released…