7 Pages

2004S1TestAnswers

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

Word Count: 1452

Document Preview

What e) is printed by the following? CompSci 101 S1 2004 City and Tamaki System.out.println(5 + 9 % 2 * (10 / 4) - 6); Terms Test Model Answers 1 Question 1 (20 marks) (2 marks) a) What is printed by the following? f) What is printed by the following? System.out.println("5" + 5 + 9); System.out.println(5 / 2.0 * 3 / 5); 559 (1 mark) 1.5 (1 mark) b) What is printed by the following? g)...

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.
What e) is printed by the following? CompSci 101 S1 2004 City and Tamaki System.out.println(5 + 9 % 2 * (10 / 4) - 6); Terms Test Model Answers 1 Question 1 (20 marks) (2 marks) a) What is printed by the following? f) What is printed by the following? System.out.println("5" + 5 + 9); System.out.println(5 / 2.0 * 3 / 5); 559 (1 mark) 1.5 (1 mark) b) What is printed by the following? g) What is printed by the following? System.out.println(6 + 3 + "8"); String string01 = "food looks good"; System.out.println(string01.indexOf("oo",4)); 98 (1 mark) 6 (2 marks) c) What is printed by the following? System.out.println((int) 5.3); h) What is printed by the following? System.out.println(Math.pow(Math.max(4,3), 2)); 5 (1 mark) 16.0 (2 marks) d) What is printed by the following? System.out.println("\"n\\\n\""); i) What is printed by the following? "n\ " System.out.print((int)3.14159 + "\nis the"); System.out.print("value of pi."); (2 marks) 3 is the value of pi. (2 marks) j) What is printed by the following? Question 2 (10 marks) String string02 = "abcdefghij"; System.out.println(string02.substring(3,string02.length()-3)); Consider the following section of Java source code, and answer the questions below: int x = 5; int y; char c = a; defg y = (int)Math.pow(x,2); Rectangle aRect = new Rectangle(x,y,30,20); String rectString = "Rect1" + " is " + aRect.toString(); (2 marks) k) What is printed by the following? String string03 = " 11 22 33 "; String string04 = string03.trim(); string04+=3; System.out.println(string04); a) List all the identifiers which appear in the above code fragment String, Math, Rectangle, x, y, c, aRect, rectString pow, toString 11 22 333 (2 marks) (5 marks) l) What is printed by the following? b) Identify all the variables in the above code fragment and categorize them according to whether they are primitive or object types. double number01 = 12; int number02 = 5; number01 -= number02; System.out.println(number01); PRIMITIVE VARIABLES: x, y, c 7.0 (2 marks) OBJECT VARIABLES: aRect, rectString (5 marks) Question 3 (10 marks) Question 4 (15 marks) You need to find and correct five errors in the program Q3. There is no more than one error on each line of code. Complete the application Q4 given below. Your application should perform the following tasks. The application program Q3 is supposed to generate a random number between 0 and 26, and then print out that number of letters from the alphabet. Three examples of the application being executed are shown below the output must be identical to that shown: 1. 2. 3. 4. Example 1: C:\>java Q3 The first 5 characters of the alphabet are abcde Two examples of the output that must be produced by your Q4 program are given below. Make sure the output of your application is identical to the format of this output. Values entered by the user are given in bold: Example 2: C:\>java Q3 The first 0 characters of the alphabet are Example 3: C:\>java Q3 The first 18 characters of the alphabet are abcdefghijklmnopqr The source code for the application Q3 is given below. Five of the lines of code contain an error of some sort. For each error, you need to clearly circle the error and provide a correction so that the program will compile and execute correctly. You do not need to write out the whole line of source code again, as long as you indicate your corrections clearly. public class Q3 { 1 Prompt the user to enter two integer values as input. Print the word "Larger:" followed by the larger of the two input integer values. Print the word "Difference:" followed by the difference between the larger and smaller input values. Print the word "Quotient:" followed by the real value obtained by dividing the first input value by the second input value. public static void main(String[] args){ String alphabet = "abcdefghijklmnopqrstuvwxyz"; 2 int index; 3 index = (int) ( Math.random() * 27 ); 4 System.out.println("The first " + index + " characters of the alphabet"); 5 System.out.println(" are " + alphabet.Ssubstring(0, index)); } } (10 marks) Example 1: C:\>java Q4 Please input first number: 5 Please input second number: 8 Larger: 8 Difference: 3 Quotient: 0.625 Example 2: C:\>java Q4 Please input first number: 10 Please input second number: -3 Larger: 10 Difference: 13 Quotient: -3.333333333333333335 Complete the source code for this application below. Some variables have been declared for you: Question 5 (15 marks) import java.io.*; Complete the implementation of the FruitProfile class for building simple fruit profiles in a grocery store. The application Q5 makes use of the FruitProfile class as shown below. public class Q4 { public class Q5 { public static void main(String[] args){ public static void main(String[] args) { int number1; int number2; int difference; double quotient; FruitProfile fruit1 = new FruitProfile("apple", 10); FruitProfile fruit2 = new FruitProfile("pear", 16); System.out.println(fruit1.toString()); fruit1.add(12); System.out.println("After adding"); System.out.println(fruit1.toString()); System.out.print("Please first input number: "); number1 = Integer.parseInt(readInput()); System.out.println(); System.out.println(fruit2.toString()); fruit2.subtract(5); System.out.println("After subtracting"); System.out.println(fruit2.toString()); System.out.print("Please input second number: "); number2 = Integer.parseInt(readInput()); difference = Math.max(number1,number2) Math.min(number1,number2); System.out.println("There are currently " + fruit1.getAmount() + " " + fruit1.getName() + "(s) in store." ); quotient = (double)number1/(double)number2; System.out.println("Larger: " + Math.max(number1, number2)); System.out.println("Difference:" + difference); System.out.println("Quotient:" + quotient); private static String readInput() { try { BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); return in.readLine(); } catch (IOException e) {} return ""; } } } The application Q5 shown above uses the FruitProfile class to create two FruitProfile objects. When a FruitProfile object is constructed, the name of the fruit (a String) and the amount in store (an int) are both specified. Given a correct implementation of the FruitProfile class, the output from the application above should be exactly as shown below. (15 marks) } } C:\>java Q5 Fruit name: apple Amount: 10 After adding Fruit name: apple Amount: 22 Fruit name: pear Amount: 16 After subtracting Fruit name: pear Amount: 11 There are currently 22 apple(s) in store. Complete the implementation of the FruitProfile class from the skeleton file given below. Question 6 (10 marks) public class FruitProfile { (a) Evaluate the following boolean expressions // instance variables private String name; private int amount; (i) true //constructor public FruitProfile(String inputName, int inputAmount){ (1 mark) name = inputName; amount = inputAmount; (ii) } 3==4 && 3 != 4 || !(3 != 3) && !(4 != 4) || 5 <= 4 true (1 mark) // add(): adds input amount to current amount public void add(int inputAmount) { amount += inputAmount; } (iii) // subtract(): subtracts input amount from current amount public void subtract(int inputAmount) { amount -= inputAmount; } ! ( ! (4 != 6) && !(5 >4)) true (1 mark) (b) DeMorgan's Law consists of the following two equivalences: // getName : returns name of fruit public String getName() { return name; } !(A && B) == !A || !B !(A || B) == !A && !B // getAmount : returns amount of fruit public int getAmount() { return amount; } Use DeMorgan's Law to help simplify the following expression. The simplified expression should not contain either of the symbols ! or != !(!(x > 42) && !(x <13)) // toString : returns String representation of fruit and current amount public String toString() { return "Fruit name: " + name + "\n" + "Amount: " + amount; } } (2 > 3) || (4 == 4) && !((4>5) || (2<3)) || (9!=2) x>42 || x<13 (3 marks) (15 marks) (b) What is the output of the following code? (c) Complete the truth table for the following boolean expression P && Q || !(P || Q) && P P Q P&&Q P||Q !(P||Q) !(P||Q)&&P P&&Q || !(P||Q)&&P T T F F T F T F T F F F T T T F F F F T F F F F T F F F (4 marks) Question 7 (10 marks) int x = 4; int y = 5; int z = 6; if(x>y || y>z) x = 0; else if(x<y && y<z) if(x==y) z=y; else y = 0; else if(y==0 || x<z) z = 0; System.out.println(x + " " + y + " " + z); (a) Translate the following sentences from English to Java (i) If a is less than 7 or b is greater than 7 then print out "greater than 7" 406 (5 marks) if( a<7 || b>7) System.out.println("greater than 7"); Question 8 (5 marks) (1 mark) (ii) Print "too easy" unless finalMark is less than 50 Assume that variables r and s have been declared as follows: Rectangle r = new Rectangle(10,20,30,40); Rectangle s = new Rectangle(10,20,30,40); (i) Write an if statement which will print out "equal value" if r is equal in value to s. if( !(finalMark < 50) ) System.out.println("too easy"); (1 mark) if ( r.equals(s) ) System.out.println("equal value"); (iii) Print "too hard", but only if finalMark is less than 50 (2 marks) (ii) Write an if statement which prints out "equal reference" if r is equal in reference to s. if( finalMark < 50 ) System.out.println("too hard"); (1 mark) if ( r==s ) System.out.println("equal reference"); (iv) If either a or b is greater than 8 and if neither c nor d is less than 8, then print "abcd" (2 marks) (iii) Are the two variables r and s equal in reference, equal in value, or both? if( (a>8 || b > 8) && !(c<8 || d<8) ) System.out.println("abcd"); equal in value (2 marks) (1 mark) Question 9 (5 marks) What is the output of the following code? int x = 25; int y = 10; int count = x; System.out.println("Before: " + count); while(count > y){ if(count%5==0) System.out.println(count); count--; } System.out.println("After: " + count); Before: 25 25 20 15 After: 10 (5 marks)
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 AUCKLANDSEMESTER ONE, 2004Campus: City and TamakiCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE: Attempt ALL questions Write your answers in the space provided There is space at the back
University of Auckland - COMPSCI - 101
CompSci 101 Semester 2, 2004Test Answers123456789101112131415161718192021222324252627282930ADDCDEDACDDEDEAADABAEDDAABDECACOMPSCI 101 - Laboratory 0631num1:num1:num1:num1:0,1,2,8,num2:
University of Auckland - COMPSCI - 101
COMPSCI 101 S2THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2004COMPUTER SCIENCEPrinciples of ProgrammingTEST Question Sheet(Time allowed: 75 MINUTES)INSTRUCTIONS:Attempt ALL questionsWrite all answers in the Answer Sheet providedCalculators are NO
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2004Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAnswer the multiple c
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2004Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAnswer the multiple c
University of Auckland - COMPSCI - 101
SUMMER SEMESTER, 2004Campus: CityCOMPUTER SCIENCETEST ANSWERSPrinciples of ProgrammingANSWERSQUESTION 1a)b)c)d)e)f)g)h)i)j)k)l)m)n)19a5 + 1.52ask ball2.02.0true[1,10]8\n&quot;-15511.010.15QUESTION 2a)The cast is performed b
University of Auckland - COMPSCI - 101
C ompSci 1 01THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2004Campus: CityCOMPUTER SCIENCETESTPrinciples of Programming(Time allowed: 75 MINUTES)NOTE:Attempt ALL questionsWrite your answers in the space providedThere is space at the back for answ
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAnswer the multiple ch
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAnswer the multiple ch
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: ONE hour and FIFTEEN minutes)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAns
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: ONE hour and FIFTEEN minutes)Surname .Forenames .Student ID .Login name(UPI) .NOTE:Attempt ALL questionsAns
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101CompSci 101 ExamSecond Semester 2005ANSWER BOOKLETSurname .ANSWERS.Forenames .MODEL.Student ID .Login name(UPI) .Examiner to complete:QuestionMark1 2255(/55)236(/6)2416(/16)257(/7)2616(/16)Total.100(/100)C
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:Attempt ALL questions.Write all answers in the attached answer booklet.Answer the multiple cho
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101CompSci 101 TestSecond Semester 2005ANSWER SHEETSurname .Forenames .Student ID .Login name(UPI) .Lab Time .Examiner to complete:QuestionMark1 15(/45)16(/5)17(/5)18(/5)19(/10)20(/10)21(/10)22.(/10)Total.(/1
University of Auckland - COMPSCI - 101
VERSION 1COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2005Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: ONE hour and FIFTEEN minutes)NOTE:Attempt ALL questions.Answer the multiple choice questions in section A by c
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2005Campus: 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, 2005Campus: 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, 2005Campus: 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 101-2Question/Answer SheetTHE UNIVERSITY OF AUCKLANDCOMPSCI 101ID:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Question 1 (40 marks)There are 20 parts to this question, each worth 2 marks. Write your answer in the spac
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2006Campus: 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, 2006Campus: 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, 2006Campus: 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 101-1Question/Answer SheetTHE UNIVERSITY OF AUCKLANDCOMPSCI 101ID:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Question 1 (20 marks)SUMMER SEMESTER, 2006Campus: Citya) What is printed by the following?System.out.pri
University of Auckland - COMPSCI - 101
University of Auckland - COMPSCI - 101
CompSci 101THE UNIVERSITY OF AUCKLANDSUMMER SEMESTER, 2006Campus: 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, 2006Campus: 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 1-1-COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2007Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:Attempt ALL questions.Answer Section A (Multiple choice Questions) on the scantron answersh
University of Auckland - COMPSCI - 101
VERSION 18832768-1-COMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2007Campus: CityCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: TWO hours)NOTE:Attempt ALL questions.Answer Section A (Multiple choice Questions) on the scantron an
University of Auckland - COMPSCI - 101
COMPSCI 101CompSci 101 TestFirst Semester 2007ANSWER BOOKLETSurname .Forenames .Student ID .Login name(UPI) .Examiner to complete:QuestionMarkQuestion1 18Mark24(/36)19(/3)25(/6)20(/3)26(/6)21(/4)27(/16)22(/6)28(/6)(/12)23
University of Auckland - COMPSCI - 101
VERSION ONECOMPSCI 101THE UNIVERSITY OF AUCKLANDFIRST SEMESTER, 2007Campus: CityTESTCOMPUTER SCIENCEPrinciples of Programming(Time Allowed: ONE hour and FIFTEEN minutes)NOTE:Attempt ALL questions.Answer the multiple choice questions in section
University of Auckland - COMPSCI - 101
COMPSCI 101THE UNIVERSITY OF AUCKLANDSECOND 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 AUCKLANDSECOND 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 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 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