For unlimited access to Homework Help, a Homework+ subscription is required.
17. An operating system manages numerous, concurrently running programs known as processes. A process control block (PCB) is a data structure that can hold a) the value of the program counter b) the values of all registers c) accounting information about the current process d) All of the above x e) None of the above
Programming section (30 points total) The following code must all go inside of a class called Midterm. 21. Write a method sum which takes as input an array of int and returns the sum of the elements in the array. For example, if the array contains 10 2 3, your method should return 15.
29. Consider the Cocktail Sort (code 4) algorithm described in the appendix. What is the fewest number of lines of code that would have to be added, removed, or changed in order for this algorithm to sort from largest to smallest? (A) Everything inside the second for loop. (B) 3 (C) 1 (D) 2 (E) Everything inside both for loops. Binary answers For the following questions you are to use your choices as they were the representation of a binary number. More precisely, A = 24, B = 23, C = 22, D = 21, and E = 20 position in a base 2 number. For example if you wanted to answer the number 23, you would translate it first as base 2 number, which is 10111, you would blacken A, C, D and E.2 Lets look at this process on your answer sheet, we have these 5 circle you can blacken. Normally you only pick one, here you might have to blacken more than one! @ ® © D ® Following the previous example, the answer we want to input is 23, its binary representation is 10111, hence the circle you would blacken are the following: