29 Oct 07 Attendance: IP, UK, WO, RR, TH, ED I New Statements: a) if () else (); b) import element.*; d.lineTo(x, y) /* draw a line from the current position to (x, y) */ d.moveTo(x, y) /* move to position (x, y) */ c) DrawingWindow d = new DrawingWindow(100,100); /*draw in a window 100x100 */ /* (0,0)-----------(10,0) | | | | | | | | | | (0,5)-----------(10,5) */ II Working on the programming problems: 1) Draw a five-line music manuscript paper: -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- -------------------------------------------- Steps: a) draw one line b) use while statements to repeat for 5 times i) try to use for statement for (int i=1; i<=5; i++) { } ii) try to use while statement: define a counter counter = 1 while (counter<=5) { counter = counter+1; } // finish iii) repeat 8 times, using while statement. 2) Draw a sequence of square boxes in a line: Steps: a) draw one box b) draw n boxes in one horizontal line c) draw n boxes in one vertical line d) draw n boxes in a diagonal line All use while statements to repeat the box n times by changing coordinates 3) Draw a sequence of square boxes in a line and each time the boxes turn a angle a) turn each time a fixed angle b) turn each time a variable amount of angle III Problems: Ida does not have the access to element.*, nor element.jar.