M257-200810 - M257/K Course Examination 2008*M2570810...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright © 2008 The Open University M257/K *M2570810* Course Examination 2008 Mathematics and Computing: Level 2 M257 Putting Java to work Friday 10 October 2008 2.30 pm – 5.30 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 together with your signed desk record on top. Fasten them in the top left corner with the round paper fastener. Attach this question paper to the back of the answer books with the flat paper clip.
Image of page 1

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

View Full Document Right Arrow Icon
M257/K 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 What is meant by a version of Java and what is meant by an edition of Java? Compare and contrast these two terms, naming examples of each. [5] Question 2 Two kinds of iteration in Java are a for-loop and a for-each loop. Explain the difference between these two kinds of iteration, giving an example of when you would use a for-loop and an example of when you would use a for-each loop. No code is required. [5] Question 3 Where does the class Object fit in the Java class hierarchy? Give two advantages of the placement of Object in the class hierarchy. [5] Question 4 Explain the concept of a stream in Java, including the difference between buffered and unbuffered streams and why you might want to flush a stream. [5] Question 5 Most object-oriented systems will require a mixture of composition and inheritance. (i) Give brief definitions of the terms composition and inheritance . (ii) Suppose that we have classes with names Car , CarRadio and FordCar . What relationships would these classes most likely have with each other (if any)? [5]
Image of page 2
M257/K 3 [TURN OVER] Question 6 Sketch or otherwise accurately describe the appearance of the window that would be created by instantiating an object of the Q6GUI class shown below, using the given constructor. Exact pixel dimensions are not important.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern