2000SCTestAnswers

2000SCTestAnswers - 415.101SC/ST 2000 Principles of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
415.101SC/ST 2000 Principles of Programming Test SOLUTIONS: Monday 21 st August 6.30pm – 7.45pm Question 1 (10 marks) Question 2 (5 marks) 1 () after String 2 == after rand 3 ; after if 4 glass 5 missing { after main Question 3 (10 marks) public void paint(Graphics g) { final int SIZE = 50; g.drawOval(0, 0, SIZE, SIZE); g.drawOval(0, SIZE, SIZE, SIZE); g.drawOval(SIZE, 0, SIZE, SIZE); g.drawOval(SIZE, SIZE, SIZE, SIZE); }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
415.101SC/ST Test August 21 2000 page 2 Question 4 (10 marks) 10.0 55.0 55.0 10.0 -3 -4 Question 5 (6 marks) Question 6 (30 marks) import java.awt.*; import java.applet.*; import java.awt.event.*; public class question07 extends Applet implements ActionListener, MouseListener { private final int SIZE = 25; /** WIDTH and HEIGHT of the square */ private final int START_X = 40; /** initial x position of the square */ private final int START_Y = 50; /** initial y position of the square */ /** current x, y of the square */ private int squareX, squareY; /** reset Button */
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

2000SCTestAnswers - 415.101SC/ST 2000 Principles of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online