2000ACTestAnswers

2000ACTestAnswers - 415.101AC 2000 Test Solutions Q.1 (5...

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

View Full Document Right Arrow Icon
415.101AC 2000 Test Solutions Q.1 (5 marks) Q.2 (5 marks) public class ApplicEsQ2 { public static void main(String args[]) { int int1, int2; System.out.println("Numbers: "); int1 = Keyboard.readInt(); int2 = Keyboard.readInt(); if (int1 > 62){ System.out.println("OK"); int1 = int1 - 3; } else { int1 = int1 + 10; if (int1 > int2) System.out.println(int1 + ", "+ int2); else { int1 = int1 - 10; System.out.println(int1 + ", "+ int2); } } } } Q.3 (8 marks)
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.101AC Test January 31, 2000 page 2 Q.4 – (8 marks) a is: 200 x is: 20 a is: 200 b is: false c is: 201.5 Q.5 – (8 marks) public String shortThenLong(String s1, String s2) { if (s1.length() < s2.length()) return s1.concat(s2); else return s2.concat(s1); } Q.6 (4 marks) false false Q.7 – (12 marks) import java.awt.*; import java.applet.*; import java.awt.event.*; public class Q7 extends Applet implements ActionListener { /** width and height of oval */ static final int SIZE = 30; /** applet width */
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

2000ACTestAnswers - 415.101AC 2000 Test Solutions Q.1 (5...

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