Lesson 3
Most people were able to the get rectangle to show up properly. However, there is a lot more to the program than just getting the correct results! Here are some very important things that many people didn't do:
- Class comments - Remember that every class gets File comments and Class comments. Most people had the File comments, but many left out the Class comments.
- The specification stated very precisely what the input prompt and output sentence were supposed to look like. Even if you missed a colon (:) or a period (.) you are not following specifications. Following specifications to the letter is very important in programming, so get used to doing it precisely!
- Checking the marker's starting location after it has been created is no good ... if it starts outside the grid, an error will occur.
- Question 2 - a compile-time error occurs, so the program won't even run.
- Question 3 - a run-time error occurs, so the program will run up to the point where the marker leaves the grid, but then it stops. Many people said the program only stopped if checkLocation() was being used ... this is not true! The program stops regardless, but if you use checkLocation(), it stops "nicely", with a little pop-up error message for the user. If you don't use checkLocation(), an ugly error is printed out in the DOS box.
- Question 4 - many people didn't know what was being asked here. The question was asking about the arguments to the move() and rotate() methods, not about the methods themselves. In other words, why be able to say "marker.move(10);" rather than just being able to call "marker.move()"? It should be fairly obvious that if we only had marker.move(), we'd have to call it 10 times to do what marker.move(10) can do in one line of code. This is how using the arguments makes our code shorter.
Even if you missed some of these things, I gave you a score based on how serious I judged the mistake to be. If you got 3/3 but still had some comments about errors, your errors were considered to be relatively minor. If you got 2/3, I thought that the errors you made could interfere with the code you write in the future, and you should make sure you understand what you did wrong.
I was also fairly lenient with regard to comment and style errors. I will be much harsher for Lesson 4, and downright ugly for Lesson 5!! This is for your own benefit, as I really don't want to see you losing points for this stuff on the major projects!
Back to Rob's Main Page ...