M257-200710 - M257/L Course Examination 2007*M2570710...

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

View Full Document Right Arrow Icon
Copyright © 2007 The Open University M257/L *M2570710* Course Examination 2007 Mathematics and Computing: Level 2 M257 Putting Java to work Monday 15 October 2007 10.00 am – 1.00 pm Time allowed: 3 hours This examination is in TWO parts and you should attempt BOTH parts. Part 1 carries 50% and Part 2 50% of the total examination score. Part 1 This part contains ten questions. You should attempt ALL the questions in Part 1 . Each question is worth 5 marks and the total score for this section is 50 marks. Write your answers in the answer book(s) provided. Part 2 This part contains three questions. You should attempt TWO questions from Part 2 . Each question carries 25 marks and the total score for this section is 50 marks. You are advised not to cross through any work until you have replaced it with another solution to the same question. In Part 2 of the paper, if you submit attempts to more than two questions your best two scores will count towards your result. Write your answers in the answer book(s) provided, starting each question on a new page. Indicate which questions you have attempted for Part 2 in the spaces provided on the front cover of your answer book. At the end of the examination Check that you have written your personal identifier and examination number on each answer book used. Failure to do so will mean that your work cannot be identified. Put all your used answer books and your question paper together with your signed desk record on top. Fix them together with the paper fastener provided.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Part 1 Answer all the questions in this part of the paper. Where appropriate you may use diagrams and code examples as well as text. Question 1 Once compiled, a Java program can be executed on many different platforms. Briefly explain how this portability is possible. [5] Question 2 Java is a strongly typed language. (i) Explain briefly what this term means and (ii) give a short code example, involving primitive data types, that would be rejected at compile time as a result of Java’s strong typing. [5] Question 3 Consider the following code which shows part of a class declaration. public class ClassB extends ClassA { public String message = ""; public int count; public String name; public boolean isEnabled; public ClassB (String s, boolean b) { super(b); name = s; } Describe the three stages of initialisation when the statement new ClassB("Server1", true); is executed. [5] Question 4 (i) Briefly state the sequence of events that takes place when the Java system detects that an Exception has been thrown within a try-catch block. Assume that an appropriate handler has been declared, that there is no finally clause, and no errors arise as a result of executing the handler. (ii) State two options open to the programmer in the
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.

This note was uploaded on 05/21/2010 for the course UK M257 taught by Professor Maiile during the Spring '10 term at Open Uni..

Page1 / 13

M257-200710 - M257/L Course Examination 2007*M2570710...

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