Post by LaevisX on Jan 20, 2002 18:11:07 GMT -5
Having taken 148 last term, and wishing to procrastinate for a few minutes right now, I think I can offer some advice regarding assignments you guys might find useful (or not ;D)
I'll talk about our A1 first. It was out of 50, with the following distribution:
10/50: Correctness (automarking)
Not much you can do here, except test and test and test your program. Definitely test extreme cases (ex. empty list, lists with 1 element, 2, 3, and many). This really depends on your assignment of course, but make sure to test extreme cases.
Another thing that got people burnt in this section, was the difference between empty strings and null strings. These are 2 different beasts, so make sure that you know the difference, and more importantly, that your _code_ knows the difference!
20/50: Interface Design
It is imperatively that _only_ methods that are supposed to print, will print. Many people got burnt to a crisp for this.
For example, say you have a class that holds and manipulates data (say, Queue.java), and a class (say A1Driver.java) that uses/tests Queue objects. And in the instructions, they just say something like, if user types in "getthis", the program will print "fukyou", without specifying which class should do the getting and which should do the printing, I'll tell you now that they should _both_ be done by A1Driver.java. Data structures (i.e. Queue.java) as a rule do not read user inputs nor do they do any kind of printing. If you're ever in doubt, compare the class you're making with a similar type of class in Java, and see what that class does. Look at the Vector class (a data structure like Queue.java). It does not print anything, right? If you want to print the elements from a Vector object, you use the elements() method which returns an Enumeration, then print that Enumeration in A1Driver.java.
10/50: Internal Design & Style
This is how "tight" your code looks. Make sure it looks tidy. Somethings to keep in mind:
1) Your program must be printable (i.e. when printed, no ugly word wraps happening. If you have really long lines in your code, break them at logical points and indent appropriately in the next line.
2) Logical use of white space makes your programs more readable (and keeps the marker happy).
3) Absolutely no magic numbers or text. Use constants.
4) Remember, just because your program works, doesn't mean it's good code. If you want to see if your code is good, give it to a friend to look over and see if they can understand what you are trying to do.
5) Comments... very important, but the book explains better than I can hope to do here.
10/50: Testing
More or less what I said before, for testing your program. Cover all extreme cases for all variables.
I guess I can offer my help to you guys if you need advice, but don't expect me to read your assignments and debug your code. I can answer general questions about course material, tutorial stuff, and coding. Since I don't expect I'll be around this forum often, feel free to email or message (don't check as often though) me. Or if there already is a topic here you want my advice on you can just email me to let me know.
I'm offering to do this cuz I'm not taking any CSC courses this term and wouldn't mind having a little exercise to keep the rust away
And bookmark this if you haven't already:
java.sun.com/products/jdk/1.2/docs/api/index.html
Cheers & good luck
I'll talk about our A1 first. It was out of 50, with the following distribution:
10/50: Correctness (automarking)
Not much you can do here, except test and test and test your program. Definitely test extreme cases (ex. empty list, lists with 1 element, 2, 3, and many). This really depends on your assignment of course, but make sure to test extreme cases.
Another thing that got people burnt in this section, was the difference between empty strings and null strings. These are 2 different beasts, so make sure that you know the difference, and more importantly, that your _code_ knows the difference!
20/50: Interface Design
It is imperatively that _only_ methods that are supposed to print, will print. Many people got burnt to a crisp for this.
For example, say you have a class that holds and manipulates data (say, Queue.java), and a class (say A1Driver.java) that uses/tests Queue objects. And in the instructions, they just say something like, if user types in "getthis", the program will print "fukyou", without specifying which class should do the getting and which should do the printing, I'll tell you now that they should _both_ be done by A1Driver.java. Data structures (i.e. Queue.java) as a rule do not read user inputs nor do they do any kind of printing. If you're ever in doubt, compare the class you're making with a similar type of class in Java, and see what that class does. Look at the Vector class (a data structure like Queue.java). It does not print anything, right? If you want to print the elements from a Vector object, you use the elements() method which returns an Enumeration, then print that Enumeration in A1Driver.java.
10/50: Internal Design & Style
This is how "tight" your code looks. Make sure it looks tidy. Somethings to keep in mind:
1) Your program must be printable (i.e. when printed, no ugly word wraps happening. If you have really long lines in your code, break them at logical points and indent appropriately in the next line.
2) Logical use of white space makes your programs more readable (and keeps the marker happy).
3) Absolutely no magic numbers or text. Use constants.
4) Remember, just because your program works, doesn't mean it's good code. If you want to see if your code is good, give it to a friend to look over and see if they can understand what you are trying to do.
5) Comments... very important, but the book explains better than I can hope to do here.
10/50: Testing
More or less what I said before, for testing your program. Cover all extreme cases for all variables.
I guess I can offer my help to you guys if you need advice, but don't expect me to read your assignments and debug your code. I can answer general questions about course material, tutorial stuff, and coding. Since I don't expect I'll be around this forum often, feel free to email or message (don't check as often though) me. Or if there already is a topic here you want my advice on you can just email me to let me know.
I'm offering to do this cuz I'm not taking any CSC courses this term and wouldn't mind having a little exercise to keep the rust away
And bookmark this if you haven't already:
java.sun.com/products/jdk/1.2/docs/api/index.html
Cheers & good luck