3 Pages

2007S2TestAnswers

Course: COMPSCI 101, Summer 2012
School: University of Auckland
Rating:
 
 
 
 
 

Word Count: 1327

Document Preview

101 THE CompSci UNIVERSITY OF AUCKLAND SECOND SEMESTER, 2007 Campus: City COMPUTER SCIENCE TEST Principles of Programming (Time allowed: 75 MINUTES) NOTE: Attempt ALL questions Write your answers in the space provided There is space at the back for answers that overflow the allotted space No calculators are permitted Surname: Forenames: Student ID number: Login name: CONTINUED Question/Answ er Sheet -...

Register Now

Unformatted Document Excerpt

Coursehero >> Other International >> University of Auckland >> COMPSCI 101

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
101 THE CompSci UNIVERSITY OF AUCKLAND SECOND SEMESTER, 2007 Campus: City COMPUTER SCIENCE TEST Principles of Programming (Time allowed: 75 MINUTES) NOTE: Attempt ALL questions Write your answers in the space provided There is space at the back for answers that overflow the allotted space No calculators are permitted Surname: Forenames: Student ID number: Login name: CONTINUED Question/Answ er Sheet - Page 2 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... CompSci 101 Test Results Question Marks Out of Question 1 10 Question 2 5 Question 3 5 Question 4 10 Question 5 20 Question 6 10 TOTA L 60 CONTINUED Question/Answ er Sheet - Page 3 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... Question 1 (10 marks) What is displayed by each of the following pieces of Java program? a) System.out.println("\"quote"); "quote (1 mark) b) System.out.println("X" + (2 + 3)); X5 (1 mark) c) int value = 13; System.out.println(value < 6); false (1 mark) d) int i = 5; int[] numbers = {4, 2, -7, 5, 1, 6, 3}; System.out.println (numbers[i]); 6 (1 mark) e) String name = "banana split"; System.out.println(name.indexOf('n')); 2 (1 mark) f) String name = "facile"; System.out.println(name.substring(1, 3)); ac (1 mark) g) String name = "peasy"; System.out.println(name.substring(1)); easy (1 mark) h) int x = 5, y = 4; System.out.println(Math.max(x, y)); 5 (1 mark) CONTINUED Question/Answ er Sheet - Page 4 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... i) int [] numbers = {2,3,4,5,6,7,8}; System.out.println(numbers[0]*numbers[3]); 10 (1 mark) j) String [] strings = {"cat","dog","snake","ocelot"}; System.out.println(strings[2].length()); 5 (1 mark) Question 2 (5 marks) Add the return type to the following Java methods: a) private int addNums(int num1, int num2) { return num1 + num2; } (1 mark) b) private void printNumber(int num) { System.out.println(num); } (1 mark) c) private String getString(char c) { return "" + c; } (1 mark) d) private double increase(int num) { return num + 1.0; } (1 mark) e) private boolean isOdd(int num) { return ((num % 2) == 1); } (1 mark) CONTINUED Question/Answ er Sheet - Page 5 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... Question 3 (5 marks) a) Write a Java boolean expression which tests if the value of the int variable, number, is less than 50. number < 50 b) (1 mark) Write a Java boolean expression which tests if the value of the int variable, number, is even. (number%2) == 0 c) (1 mark) Write a Java boolean expression which tests if the value of the boolean variable, isThin, is false isThin == false d) (1 mark) Write a Java boolean expression which tests if the value of the String variable, name, has the same characters in the same order as "George". name.equals("George") e) (1 mark) Write a Java boolean expression which tests if the value of the int variable, number, is not zero and divides evenly into 500 (number != 0) && ((500 % number) == 0) (1 mark) CONTINUED Question/Answ er Sheet - Page 6 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... Question 4 (10 marks) Complete each of the methods below as specified in the comment preceding each method. a) // method to find the smallest of three numbers private int smallest(int x1, int x2, int x3){ return Math.min(x1,Math.min(x2,x3)); } (2 marks) b) // method to decide whether two numbers are in ascending // order private boolean areInOrder(int n1, int n2){ return n1 < n2 ; } (2 marks) c) // method to return the last half of a String (including // the middle character if the length is odd) private String lastHalf(String s){ int middle = s.length() / 2; return s.substring(middle); } (2 marks) d) // method to tell whether one String, s1, is the first // part of a longer String, s2 (e.g. isStart("ab","abcd") // is true, but isStart("ab","acbd") is false private boolean isStart(String s1, String s2){ int s1Length = s1.length(); String firstPartOfS2 = s2.substring(0,s1Length); return s1.equals(firstPartOfS2); } CONTINUED Question/Answ er Sheet - Page 7 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... (2 marks) e) // method to display the first parameter, s, the number of // times given by the second parameter, n. The output // should all be on one line, with no extra spacing. private reiterate(String void s, int n){ for (int i=0; i<n; i++){ System.out.print(s); } } (2 marks) CONTINUED Question/Answ er Sheet - Page 8 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... Question 5 (20 marks) a. Complete the method incomeInRange() which accepts a positive double parameter income and two double bounds, lower and upper, where lower <= upper. The method returns the amount of the income that is between the two bounds. You may use if-statements to answer this question. Do not use Math class methods. // method to find the income within a range private double incomeInRange (double income, double lower, double upper) { if (income <= lower) { return 0; } if (income > upper) { return upper - lower; } return income - lower; } (5 marks) b. Complete the method called getBoundedInt() which prompts the user to type in an int value less than the value of the int parameter bound. A user who types a number that is greater than, or equal to, bound, is continually re-prompted to provide an int value less than bound. When the user has typed a correct value it is returned as the value of the method. You should make use of the helper method getUserInt()that reads the user input and returns it as an int // method to get a bounded int from the user private int getBoundedInt(int bound) { System.out.print("Type in a number less than " + bound); int number = getUserInt(); while (number >= bound){ System.out.print("Type in a number less than " + bound); number = getUserInt(); } return number; } CONTINUED Question/Answ er Sheet - Page 9 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... (5 marks) c. Complete the method rotateLeft() which accepts a String parameter word, and returns the String rotated one character to the left, e.g. "luck" gives the result "uckl" // method to find a word rotated to the left, e.g. "luck" // gives result "uckl" private String rotateLeft (String word){ char firstChar = word.charAt(0); String wordTail = word.substring(1); return wordTail + firstChar; } (5 marks) d. Complete the method isAllUpperCase() which accepts a String parameter, word, and returns true if every character in word is upper case, and false otherwise. You may use the method Character.isUpperCase(char c) that determines whether char c is an upper case character. // method to see if a word is all upper case private boolean isAllUpperCase(String word) { boolean allSoFar = true; // all letters so //far tested are upper case for (int i = 0; i < word.length(); i++) { if (Character.isUpperCase(word.charAt(i)) == false) { allSoFar = false; } } return allSoFar; } (5 marks) CONTINUED Question/Answ er Sheet - Page 10 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... Question 6 (10 marks) a) What is the output when the following start()method is executed? // mystery program public void start() { String s1 = "trial"; String s2 = ""; for (int i = 0; i<s1.length(); i++) { char c = s1.charAt(i); s2 = c + s2; System.out.println(s2); } } Show the output here: t rt irt airt lairt (5 marks) b) What is the output when the following start()method is executed? Note that the helper method printArray() just displays all of the elements of its parameter array on one line. // mystery program public void start() { int[] numbers = {1,1,1,1,1}; printArray(numbers); numbers = bump(numbers); printArray(numbers); numbers = bump(numbers); printArray(numbers); } // helper method to print an array of ints on one line private void printArray(int[] a) { for (int j=0; j<a.length; j++) { System.out.print(" " + a[j]); } System.out.println(); } CONTINUED Question/Answ er Sheet - Page 11 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... // method to do something with an array of int numbers private int[] bump(int[] nums) { int[] value = new int[nums.length]; for (int j=0; j<nums.length; j++) { value[j] = nums[j] + j; } return value; } Show the output here: 11111 12345 13579 (5 marks) CONTINUED Question/Answ er Sheet - Page 12 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... ROUGH WORKING (WILL NOT BE MARKED) (You may detach this page from the answer booklet and use it for rough working) CONTINUED Question/Answ er Sheet - Page 13 - CompSci 101 S2 C SURNAME: ...................................................... FOR EN AMES: ........................................................... ROUGH WORKING (WILL NOT BE MARKED) (You may detach this page from the answer booklet and use it for rough working)
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2007Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2007Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2007Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2007Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2007Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:Attempt ALL questions.Answer Section A (Multiple choice Questions) on the teleform answersheet attached. Answer Secti
University of Auckland - COMPSCI - 101
VERSION 18832768-1-COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:Attempt ALL questions.Answer Section A (Multiple choice Questions) on the teleform an
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2008Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time allowed: TWO hours)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2008Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE: Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE: Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2009Campus: CityTESTCOMPUTER SCIENCEPrinciples of Programming(Time allowed: 75 minutes)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2009Campus: CityTESTCOMPUTER SCIENCEPrinciples of Programming(Time allowed: 75 minutes)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in t
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in t
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSEMESTER TWO, 2009Campus: CityCompSci 101TESTCOMPUTER SCIENCEPrinciples of Programming(Time allowed: 75 minutes)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back f
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSEMESTER TWO, 2009Campus: CityCompSci 101TESTCOMPUTER SCIENCEPrinciples of Programming(Time allowed: 75 minutes)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back f
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE: Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2009Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE: Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answers that
University of Auckland - COMPSCI - 101
CompSci 101Question/Answer Sheet- Page 2 -CompSci 101 SS CSURNAME: . FORENAMES: .THE UNIVERSITY OF AUCKLANDQuestion 1 (40 marks)a) What output is produced by the following code?String sentence = &quot;I LOVE SUMMER SCHOOL!&quot;;String part = sentence.subs
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2009Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE: Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answer
University of Auckland - COMPSCI - 101
VERSION 00000001COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2010Campus: CityComputer SciencePrinciples of Programming(Time Allowed: TWO HOURS)SECTION A Question BookletNote: The use of calculators is NOT permitted. You should separate
University of Auckland - COMPSCI - 101
VERSION 00000001COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2010Campus: CityComputer SciencePrinciples of Programming(Time Allowed: TWO HOURS)SECTION A Question BookletNote: The use of calculators is NOT permitted. You should separate
University of Auckland - COMPSCI - 101
VERSION 00000003COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2010Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)Note: The use of calculators is NOT permitted. Compare the test version number on the Te
University of Auckland - COMPSCI - 101
VERSION 00000003COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2010Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)Note: The use of calculators is NOT permitted. Compare the test version number on the Te
University of Auckland - COMPSCI - 101
THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2010Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in this booklet.
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2010Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in t
University of Auckland - COMPSCI - 101
THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2010Campus: CityCOMPUTER SCIENCETEST SOLUTIONSPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provided
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2010Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
Question/Answer SheetCompSci101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2010Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in th
University of Auckland - COMPSCI - 101
Question/Answer SheetCompSci101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2010Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in th
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2010Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2010Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
VERSION 00000001COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Note: The use of calculators is NOT permitted. You should separate the Section A Question Book
University of Auckland - COMPSCI - 101
VERSION 00000001COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Note: The use of calculators is NOT permitted. You should separate the Section A Question Book
University of Auckland - COMPSCI - 101
VERSION 00000003COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)Note: The use of calculators is NOT permitted. For Section A, use a dark pencil to mark
University of Auckland - COMPSCI - 101
VERSION 00000003COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)Note: The use of calculators is NOT permitted. For Section A, use a dark pencil to mark
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the spaces provided in
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the spaces provided in
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the spaces provid
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the spaces provid
University of Auckland - COMPSCI - 101
THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in this booklet.
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2011Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:You must answer all questions in this exam.No calculators are permittedAnswer in the space provided in t
University of Auckland - COMPSCI - 101
THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provided in this bo
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2011Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2012Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2012Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time Allowed: 75 minutes)NOTE:You must answer all questions in this test.No calculators are permittedAnswer in the space provide
University of Auckland - COMPSCI - 101
COMPSCI 101SUMMER SCHOOL2012- Principles of Programming Lecture times and locations (rooms subject to change)Monday: 10:00 am - 11:00 am ClockT029/105-029 (ClockTower building)Tuesday: 10:00 am - 11:00 am ALR5/421W-301 (Architecture building)Wednesd
University of Auckland - COMPSCI - 101
2!Welcome to CompSci 1 1!Will be available on the web!Introduction to the Compsci 101 course!!Algorithms!!Programming steps!!!Lab One Worksheet!Course Information Document3!CompSci 101 People!People cont.!Ann Cameron (Lab Supervisor) !!4
University of Auckland - COMPSCI - 101
Computer Science 1 1 SS CLecture 2 Contents!2!Computer Organisation!Most computers consist of three major components:Compilers, interpreters and java!javac, java commands!Installing Java!Writing the &quot;Hello World&quot; program!!Coursebook: 1! a proce
University of Auckland - COMPSCI - 101
Computer Science 1 1 SS CLecture 3 Contents!2!Review!Write the source code for the application (whichstarts the program).Java Syntax!Displaying Output!MyApplication.javapublic class MyApplication cfw_public static void main(String[] args) cfw_M
University of Auckland - COMPSCI - 101
Computer Science 1 1 SS CLecture 4 Contents!2!Review!What is the output of the following two programs?Java has eight primitive types!Storing information - variables!The assignment statement!Expressions !Modulus!Increment, decrement operators!!
University of Auckland - COMPSCI - 101
Computer Science 1 1 SS C Lecture 5 Contents&quot;&gt; java ReviewAppDeposit $455Current balance $955.535Review&quot;1 public class Review cfw_public void start() cfw_2int amount, leftOvers;3 double balance; 4amount = 435;5 6 l