[exit Q&A]
Questions and AnswersThe first picture can be obtained by having a for loop executing 10 iterations.
The body of the loop should include a
instruction for drawing a line.
To find out the exact format of drawLine, find out what is the class type of g, and then visit the web page describing that type.
Probably the values of the arguments are inappropriate.
Right, we didn’t talk about it in class. Can you answer the following questions: (1) What makes a dot random? (2) What makes a line random?
It doesn’t matter which of i = i + 1, i++, and ++i is employed, because they all produce the same outcome in i. The value returned by the expression not used anywhere. The case would be different, for instance, in the following code.
Yes.