2010S1TestQuestions

2010S1TestQuestions - VERSION 00000003 COMPSCI 101 THE...

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

View Full Document Right Arrow Icon
VERSION 00000003 COMPSCI 101 CONTINUED THE UNIVERSITY OF AUCKLAND FIRST SEMESTER, 2010 Campus: City COMPUTER SCIENCE TEST Principles of Programming (Time Allowed: 75 minutes) Note: The use of calculators is NOT permitted. Compare the test version number on the Teleform sheet supplied with the version number above. If they do not match, ask the supervisor for a new sheet. Enter your name and student ID on the Teleform sheet. Your name should be entered left aligned. If your name is longer than the number of boxes provided, truncate it. Answer Section A (multiple-choice questions) on the Teleform answer sheet provided. Answer Section B in the space provided in this booklet. Attempt all questions. For Section A, use a dark pencil to mark your answers in the answer boxes on the Teleform sheet. Check that the question number on the sheet corresponds to the question number in this question/answer book. Do not cross out answers on the Teleform sheet if you change your mind. You must completely erase one answer before you choose another one. If you spoil your sheet, ask the supervisor for a replacement. There is one correct answer per question. For Section B, write your answers in the spaces provided in this booklet. Write as clearly as possible. The space provided will generally be sufficient but is not necessarily an indication of the expected length. Extra space is provided at the end of this exam book. An appendix with a simplified API is included on the last page. Surname: First Name(s): Student ID: Login Name (UPI): Your marked test script will be returned during the weekly lab sessions. In the box below, clearly write the DAY OF THE WEEK and the STARTING TIME of the lab session where you would like your test script returned. LAB TIME: where your marked test will be returned Day of week Starting time of lab
Background image of page 1

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

View Full DocumentRight Arrow Icon
VERSION 00000003 - 2 - COMPSCI 101 CONTINUED MARKERS ONLY Question Marks Out Of 1 - 20 40 21 13 22 16 23 18 24 13 Total 100
Background image of page 2
VERSION 00000003 - 3 - COMPSCI 101 CONTINUED 1) What is the output of the following code? int a = 5; int b = 10; int c; c = a; a = b; b = c; System.out.println(a + " " + b + " " + c); (a) 10 5 10 (b) 10 5 5 (c) 5 10 10 (d) 5 10 5 (e) 10 10 5 2) What output is produced when the following code is executed? int x = 9; int y = 4; String s = " + "; System.out.println(x - y + s + y + y); (a) 5 + 8 (b) 5 + 44 (c) 13 (d) 49 (e) None of the above
Background image of page 3

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

View Full DocumentRight Arrow Icon
VERSION 00000003 - 4 - COMPSCI 101 CONTINUED 3) What output is produced when the following code is executed? int a, b; double c, d; a = 5; b = a + 2; c = b + 2; d = c + 2; c = c / 2 * 2; b = b / 2 * 2; System.out.println("a: " + a + " b: " + b + " c: " + c + " d: " + d); (a) a: 5 b: 7 c: 9.0 d: 11.0 (b) a: 5 b: 6 c: 9.0 d: 11 (c) a: 5 b: 6 c: 9 d: 11.0 (d) a: 5 b: 7 c: 9.0 d: 11 (e) None of the above 4) What output is produced when the following code is executed?
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

2010S1TestQuestions - VERSION 00000003 COMPSCI 101 THE...

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

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