## Question: Problem 4. (20 pts) Determine whether function f : {NU 0} + {NUO} defined by f(x) = is a) one-to-…

Problem 4. (20 pts) Determine whether function f : {NU 0} + {NUO} defined by f(x) = is a) one-to-one b) onto. (x – 1, ifa is odd 3+1, is even

## Question: What is output of the following codes: linkedQueueType queue; queue. addQueue (2.718); queue. add…

What is output of the following codes: linkedQueueType queue; queue. addQueue (2.718); queue. addQueue (1.618); queue. addQueue (3.142); queue. addQueue (0.279); queue. addQueue (queue. front() queue, back()); queue. addQueue (queue.back() * 2); queue. deleteQueue (); queue. addQueue (queue. front() / 2); linkedQueueType tempQueue = queue; tempQueue. deleteQueue (); tempQueue.deleteQueue (); while (!tempQueue.isEmptyQueue ()) { cout << queue. front() + tempQueue. front() < " "; queue. deleteQueue (); tempQueue.deleteQueue ();

## Question: 17. The output of the following code is 2 4. Which of the following correctly replaces the missin…

17. The output of the following code is 2 4. Which of the following correctly replaces the missing lines in the code? #indude void f(int *ptr) { int y = 2; ptr = &y; //line1 } main() { int x = 4, *ptr; ptr = &x; f(8x); Illine2 } 0 Linel: printf(“%d”, *ptr); and Line2: printf(“%d”, *ptr); (ii) Linel: printf(“%d”,y); and Line2: printf(“%d”, *ptr); (li) Linei: printf(“%d”, *ptr); and Line2: printf(“%d”,x); (iv) Linel: printf(“%d”,y); and Line2: printf(“%d”, x); (4 Points) (iv) only () only OOOO () and (ii) only All of them

## Question: Which is the sequence of instructions needed to push registers \$ra and \$s0 onto the stack. addi \$…

Which is the sequence of instructions needed to push registers \$ra and \$s0 onto the stack. addi \$sp,\$sp,-8 sw \$ra,(\$sp) sw \$50,4(\$sp) O lw \$ra,(\$sp) lw \$50,4(\$sp) addi \$sp,\$sp,8 None of the mentioned

## Question: For an InGaAsP LED operating at a wavelength of 1550 nanometer with internal quantum efficiency o…

For an InGaAsP LED operating at a wavelength of 1550 nanometer with internal quantum efficiency of 0.8. For internal power Pint of 20 milliWatt, what will be the injection current? Select one: a.,40 mA b. 31.3 mA c. 0.0391 A d. 39.1 mA

## Question: Java code. Define a class of objects that represent a location. Each object should contain an int…

Java code. Define a class of objects that represent a location. Each object should contain an integer x,y coordinate pair, and a string to label the location. Write a constructor, some getter methods, and a toString method. 1

## Question: (k) (2 points) A computer bus consists of data linies, control lines and power lines. True O Fals…

(k) (2 points) A computer bus consists of data linies, control lines and power lines. True O False .. (1) (2 points) An x86-64 CPU cannot address a separate byte of memory. O True O False 25 (m) (2 points) Stack overflow typically occurs when we are trying to push a value of the incorrect type on the stack. False O True (n) (2 points) A 100-stage pipeline can theoretically provide 100.1 times speedup. O True False fo) (2 points) Size of the CPU Li cache is typically about 5% of the RAM size. O True False (P) (2 points (bonus)) The following is the correct Hamining code fodd parity) for the hexadecimal digit A (Note: you won’t get points without explanation: 1010010 The False (0) (1 point (bonus) The modem Intel Xeon processors have 1A6! architecture [Note: you won’t get points without explanation: True FARO

## Question: 17. Consider the code int *fun(int *p) while(*p >= 0) p++; return p; } void maino int*q; int v…

please answer fast

please answer sub question
17. Consider the code int *fun(int *p) while(*p >= 0) p++; return p; } void maino int*q; int v={1,2,3,-4,5,6,7,8}; q = fun(v); printf(“%d”, _Missing_1__); printf(“%d”, _Missing 2); } However, part of the code is missing (indicated by output The code is supposed to give the -4 6 What can the missing parts be? (4 Points) Missing_1: *q Missing_2:9 Missing_1: v Missing_2: Missing_1: *q Missing_2: q Missing_1: *(q+1) Missing_2: *(q+2) 16. The output of the following code is “1”. The printf(“%d”,z); statement is only used once to print the value of variable z. In which of the following can the printf statement used? void fint z) { // line 1 ++z; // line 2 return; سه int main(void) { int z=1; // line 3 func(z); // line 4 return 0; } (2 points) Line 1 only Line 1 or Line 3 only Line 1 or Line 3 or Line 4 only d) Line 1 or Line 2 only

## Question: 15. The output of the following code is 24. Which of the following correctly replaces the missing…

15. The output of the following code is 24. Which of the following correctly replaces the missing lines in the code? #include void fint *ptr) int y = 2 ptr = &y: line 1 maino int x = 4, “ptr: ptr = 8c f(&x); //line2 } 0 Line 1: printf(“%d”:”ptr) and Line I printf(“%d”. *ptr) (i) Line 1: printf(“%d”. y): and Line2: printf(“%d1 ptr): Giii) Line 1: printf(“%d”, *ptr): and Line2: printf(“%d”,x) (iv) Line1: printf(“%d”.y): and Line2: printf(%dx): (4 Points) Dwonly only and only All of the

## Question: Ensure you use principles of cohesion, coupling, delegation and encapsulation to do so.

ensure you use principles of cohesion, coupling, delegation and
encapsulation to do so.