------------------------------------------------------------------------------
This is an automatic message sent to all CS-10 students, Spring 2007
------------------------------------------------------------------------------
Greetings,
Sorry for yet another spam. But don't worry, this is not the last one. There will be more :D
You don't have to read it as it is mostly a clarification of what has already been said on the assignment sheet and the lectures. But if you feel like reading, here you go:
Today, I've got the following questions that I think are worthwhile.
::: FAQ :::
QUESTION: How do I know my grades for hw1?
ANSWER:
Uh? Don't you know it, yet? You're supposed to get it by email. If not, ask Dr Jacobson right away. Somehow, the email might have been lost in transit.
QUESTION: My triangle goes negative when n is big. Why?
ANSWER:
You are encouraged to re-read the "Warning and hints" section of the homework. Also, think about what Dr Jacobson said yesterday in class (when he opened Excel and put in some formula). If that doesn't help, then consider the following facts:
- The biggest value an integer can hold is 2^31-1. That's around 2 billion.
- If you add something together and the result is more than that value, it will "wrap around" and become negative.
- For any a, b, and k: (a + b) % k == ((a % k) + (b % k)) % k. Don't ask me why. It's a number theory thing. But it's useful to know for this assignment. To put it in human language: mod of the sum is the same as mod of the (sum of the mods). Oops, that sounds more confusing. Sorry. But the important thing is that the thing on the left side may exceed 2 billion if a and b are big. The thing on the right cannot get bigger than 2k, and you know that k is small (at most 9).
QUESTION: Do I have to indent my code nicely for this assignment?
ANSWER:
Yes. It is clearly stated in the "Notes" section of the handout. Please review my Java Style Guide.
http://cs10s07.blogspot.com/2007/04/java-coding-style-guide.html
For examples: limit line length to 80 chars. Don't use tabs, but use spaces. Be consistent on indentation levels. Stay away from long // comments. Prefer /* this style */ for multi-line comments. Use names that make sense. Make things private if possible.
Hint: I will be extra picky on the code that does not run correctly or does not compile. If you have a good style, it's easier for me to understand your logic and give you more partial credits.
QUESTION: Are comments required?
ANSWER:
Same as the previous question. Please write some comments, but don't write an essay. You won't be penalized from writing too much, though, but it's not good for your hands ;)
QUESTION: I hate Notepad.
ANSWER:
Is that a question? :P
Anyway, ...
Here are my personal recommendations. I do not endorse these products but I've used them and I'm happy with them. I'll be very happy to help during office hours if you need help with installation. But I may not reply emails about them (since it usually takes a long explanation).
- For Windows: I use Crimson Editor.
- For Macs: I use Smultron.
- For Linux: I use emacs.
They will help you indent better. They will do syntax highlighting. They are all free!
Best,
- Mock
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment