Sunday, February 25, 2007

homework 1

Homework 1 is graded. If you submitted it on time, you will get it back soon.

Please review the solution and look at my comments -- even if you've got a good grade. Sometimes, there are minor mistakes that worth a note, but I didn't always take off points.

Grade dispute can be done in person during office hours, or by appointment.

These are some problems many people made mistakes on:

Problem
Comments
2b
The answer is "EMPTY STRING". Please note that there is a difference between null and empty strings.
2c
The answer is "STATIC". Normally, when we have a non-static method inside a class C, we have to call it by
_variableName.methodName();

where _variableName is a variable of type C. We cannot simply call:
C.methodName();

unless the method is static.
5a
javax.swing.JApplet is extended to create an applet. JFrame is not the correct answer. JFrame is used to create a window for a java application.
5g
The answer can be: blueprints, guides, stamps, models, cookiecutters.
9c
An algorithm is a set of steps leading to a result. Pseudocode can help develop an algorithm because it focuses on the steps, not the language.

An algorithm is NOT a process of refining pseudocode. An algorithm is a process of solving a problem. Pseudocode is used to describe an algorithm.
9e
To write a loop, one must not forget to set an initial value to the counter.
10c
Many of you wrote that in a sentinel-controlled repetition, the number of times the code is repeated depends on user's input. This is not wrong, but not entirely true. It could depend on a lot of other things: e.g. result of a calculation, random number, state of the machine, network data.

Please also check my calculation on the cover page. In summing up your scores, I may have made some mistakes. My apology if that really happens. :)

- Mock

No comments:

Contributors