0% 0 votes, 0 avg 23 1234567891011121314 This quiz randomly generates 14 questions as asked in AP Computer Science A (AP CSA) - Programming in Java. Congratulations! AP Computer Science A (AP CSA) - Programming in Java This quiz randomly generates 14 questions (in 30 mins) as asked in AP Computer Science A (AP CSA) - Programming in Java. 1 / 14 What is the output? 1:2:3:4:5: 1:2:3: Compilation fails An ArrayOutOfBoundsException is thrown at runtime 2 / 14 What is the output? [1, 2, 3] [1, 3, 4] [2, 3, 4] Compilation fails [3, 4, null] 3 / 14 Question I only II only III only I, II, and III All will do this correctly. 4 / 14 Refer to the Point, Quadrilateral, and Rectangle classes below: I only II only III only I and Il only II and IlI only 5 / 14 What is the output? An exception is thrown at runtime. 07-31-2014 2014-07-31 2014-09-30 6 / 14 Which assertion is true just before each execution of the while loop? arr[first) < key < arr[last] arr[first] ≤ key ≤ arr[last] arr[first] < key < arr[last] or key is not in arr arr[first] ≤ key ≤ arr[last] or key is not in arr key < arr[first] or key ≥ arr [last] or key is not in arr 7 / 14 A method is to be written to search an array for a value that is larger than a given item and return its index. The problem specification does not indicate what should be returned if there are several such values in the array. Which of the following actions would be best? The method should be written on the assumption that there is only one value in the array that is larger than the given item. The method should be written so as to return the index of every occurrence of a larger value. The specification should be modified to indicate what should be done if there is more than one index of larger values. The method should be written to output a message if more than one larger value is found. The method should be written to delete all subsequent larger items after a suitable index is returned. 8 / 14 Question Which of the following is a false statement about the methods? equals, lessThan, and toString are all accessor methods. increment is a mutator method. Time() is the default constructor. The Time class has two constructors. There are no static methods in this class. 9 / 14 Question 6143 6144 6145 6146 6147 10 / 14 What output will be produced by invoking secondTestMethod for a Tester object, assuming that testArray contains 3, 4, 5? 3 4 5 4 5 6 5 6 7 0 0 0 No output will be produced. An ArrayIndexOutDfBoundsException will be thrown. The array will not be changed by the increment method. Nor will the local variable element! What will be changed by increment is the copy of the parameter during each pass through the loop. 11 / 14 Which two modifications, when made independently, enable the code to print joe:true:100.0 ? ( Choose Two) Replace line2 with: e.name = "Joe"; e.contract = true; e.salary = 100; Replace line2 with: this.name = "Joe"; this.contract = true; this.salary = 100; Replace line n1 with: this.name = new String("Joe"); this.contract = new Boolean(true); this.salary = new Double(100); Replace line n1 with: name = "Joe"; contract = TRUE; salary = 100.0f; Replace line n1 with: this("Joe", true, 100); Option B : will not work because this. cannot be used in static content / main method Option D: // --> TRUE gives complitaion error Option E: // --> could be used to call a constructor w/ 3 parameters 12 / 14 What will the output be? 3 2.5 7 6.5 0 0.0 Compilation fails 13 / 14 What is the output? 1 2 3 0 01 2 3 0 0 An Exception is thrown at run time. 1 2 3 0 01 2 3 1 2 31 2 3 14 / 14 Question I only II only I and II only II and III only I and III only Your score is 0% Restart quiz