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? A B A element 0 B element 1 A Null Pointer Exception is thrown at runtime. A 0 B 1 2 / 14 What is the output? An exception is thrown at runtime. 07-31-2014 2014-07-31 2014-09-30 3 / 14 What is the output? 5:5 5:10 10:10 Compilation Fails 4 / 14 What is the output? Nothing is printed An Exception is thrown Compile Error May 15, 2004 5 / 14 Question Round-off eror was caused by calculations with floating-point numbers. Type boolean was not recognized by an obsolete version of Java. An overflow error was caused by entering numbers that were too large. c and d should have been cast to integers before testing for equality. Bad test data were selected. 6 / 14 Question An ArithmeticException will be thrown. A syntax error will occur. statement1, but not statement2, will be executed. statement2, but not statement1, will be executed. Neither statementl nor statement2 will be executed; control will pass to the first statement following the if statement. 7 / 14 Which code fragment, when inserted at line 6, enables the code to print true? String str2 = str1; String str2 = new String(str1); String str2 = sb1.toString(); String str2 = "Duke"; 8 / 14 Refer to the Card and Deck classes shown below. Which of the following represents correct /* implementation */ code for the constructor in the Card class? mySuit = suit; myValue = value; suit = mySuit; value = myValue; Card = new Card(mySuit, myValue) ; Card = new Card(suit, value); mySuit = getSuit(); myValue = get Value) ; (A) In the constructor, the private instance variables mySuit and myValue must be initialized to the appropriate parameter values. Choice A is the only choice that does this. 9 / 14 What is the output ? Hello Log 2:2 Log 2:2 Hello Log 2:2 10 / 14 What will the output be? 3 2.5 7 6.5 0 0.0 Compilation fails 11 / 14 Question 111101bin 101111bin 10011bin 110100bin 101101bin 12 / 14 Question 74 47 734 743 347 13 / 14 Question 32 225 255 256 272 14 / 14 Question If the array is initially sorted in descending order, then insertion sort will be more efficient than selection sort. The number of comparisons for selection sort is independent of the initial arrangement of elements. The number of comparisons for insertion sort is independent of the initial arrangement of elements. The number of data movements in selection sort depends on the initial arrangement of elements. The number of data movements in insertion sort is independent of the initial arrangement of elements. Your score is 0% Restart quiz