OC userin Computer Science·22 Dec 201723. Consider again the array a = {5,7,1,4,1} and the Selection Sort (code 2) algorithm. What is the last value of the variable minPos, before the algorithm exits? (A) 0 (B) 4 (C) 2 (D) 5 (E) 1
OC userin Computer Science·21 Dec 2017Syscene.UU.VIILIIllesUIL! 8. Consider a method with the header: public static boolean method (int x, boolean y) Is boolean b = method(10+2, true &&0) a valid way to call it? Write YES or NO
OC userin Computer Science·22 Dec 2017standard. 26. Ethernet is standardized as the a. 802.11 b. 802.3 C. 802.15 d. ZigBee
OC userin Computer Science·19 Dec 20173. Which image is drawn by the following program? translate (50, 50); rotate (radians (45)); line (0, 0, 20, 0); translate (20, 0); rect(0, 0, 20, 10);
OC userin Computer Science·20 Dec 201710. Consider a method with the header: public static int method (String x) Is method ("" + method ("10")) a valid way to call it? Write YES or NO
OC userin Computer Science·19 Dec 201726. In a computer network, the amount of data transmitted along a communication path in a unit of time is called a) Message b) Bandwidth x c) Latency d) Packet e) All of the above
OC userin Computer Science·17 Dec 201712. What will the following print ? public class Test public static void main (String[] args) boolean bl = true; boolean b2 = false; boolean b3 = true; if ((bl && b2) || (b2 && b3) || b2) System.out.print("ok"); if ((bl && b2) || (b2 && b3) 11 (bl || b2)) System.out.println("dokey"); (A) No output is produced (B) ok (C) dokey (D) Compile-time error (E) ok dokey
OC userin Computer Science·15 Dec 201723. In a file system the term refers to the assurance that data remains accurate and consistent over its entire life cycle, and particularly in the case of system crashes and failures. a) Data longevity b) Data security c) Data integrity x d) Fragmentation e) All of the above
OC userin Computer Science·17 Dec 201711. How many times does the letter K get printed in the following code? for (int i = 0; i < 5; i++) System.out.println("K"); for (int j = 0; j
OC userin Computer Science·17 Dec 20175. Inside a class, you can declare multiple methods with the same name, provided that all such methods have different input arguments. (A) FALSE (B) TRUE
OC userin Computer Science·13 Dec 201716. What does the following program print? void setup() { int x = 10; it = x; printit(); it = 20; printit(); printit(); int it; void printit() { println (it); it = 0;
OC userin Computer Science·12 Dec 201719. How many times does the letter C print in the following code? for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { for (int k = 0; k < 2; k++) { System.out.println("C"); System.out.println("C"); System.out.println("C"); (D) 36 (E) 18
OC userin Computer Science·13 Dec 2017Longer multiple choice questions (3 points each) Coding Question - Fibonacci sequence You are to write a method named "Fibo" that takes as input an integer n, and returns the nth number in the Fibonacci sequence. If Fibo (n) denotes the nth number in the Fibonacci sequence, then recall for n > 2, Fibo (n) = Fibo (n-1) + Fibo (n-2), and Fibo (1) = 1 and Fibo (2) = 1. You are to assume that the user is always going to enter an input greater than 2. For example Fibo (4) = 3. Use the 7 following questions to "write" your code. Pay close attention to how your answers group together with each other. 26. Line 1 (A) public static int Fibo (int n) { (B) public static void main(String[] args) { (C) public static int Fibo () { (D) public static void Fibo (Double input) { (E) public static void Fibo (int n) {
OC userin Computer Science·11 Dec 201753. Line 1 (A) public static void Triangle (int height) { (B) public static void Triangle() { (C) public static int Triangle (int height) {