
(i) Explain in full detail what the following code aims to achieve and how it achieves this. b invb WHEN sub '0' ELSE not bi c < a + binv + ("0" & sub ); [6 marks] 24 conti...
5) Consider the following Verilog code if (A) y- 1 else if (B) y-2 else if (C) y 3 else if (D) y 4 else у 0; Show what would most likely be synthesized. 6) Rewrite the code from the previous problem as a case statement. Show what would be synthesized if the parallel case synthesis directive is used.
5) Consider the following Verilog code if (A) y- 1 else if (B) y-2 else if (C) y 3 else if...
QUESTION 1 Consider the following section of code. Assume the syntax is correct and that it will execute. This question is worth 6 points. int numbers[6]; int sub; for (sub = 0; sub <= 5; sub += 2) numbers[sub] = sub; What is contained in the array numbers? A. numbers 0 1 2 3 4 5 x x x x [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ x...
please explain very well.Thanks
Question 3) What is the output of the following code? (4 marks) #include <stdio.h> int main(void) Output: int i; for (i = 0;i<4; i++) static int a = 0; int b = 0; a++; b++; printf("%d %d", a,b); 11213141
24) (3x2 marks) Consider the following method: public static int mysteryl (int a, int b) ( int result 0: if (a <b) ( else if (a b) else ( return result: result mystery2 (a) mystery2 (a)i result - mystery2 (b) result-ab; public static int mystery2 (int x) f int countx for (int i 0; іск; i++) count +1: return counti What are the values stored in the variable result after the following method calls? a) int result mysteryl(4,1): b) int...
What is the value of GPA when grade is 'B' in the following code segment? int GPA=0; switch (grade) { case 'A': case 'a': GPA = GPA + 1; case 'B': case 'b': GPA = GPA + 1; case 'C': case 'c': GPA = GPA + 1; case 'D': case 'd': GPA = GPA + 1; } 4 3 2 1 None of the above #2. Branching - switch statements... Extra info/hint? It's free What is the value of GPA when...
6 Marks Question 2 This question is related to Human Computer Interaction (HCI) (a) Explain what is meant by the term "user centred design". How can it be best achieved? (2 marks) (b) Which of Shneiderman and Plaisant's 8 golden rules for interface design do you consider to be the most important? Explain your answer. (2 marks) What data entry methods should be employed (if possible) in a user interface (c) that aims to minimise errors arising from invalid data...
Question 18 CLO3 Analyze the following code and answer the questions that follow def F(n): If n <= 1: return n else: return F(n-1)+F(n-2) for i in range (n) print (F(i)) Result: 0 1 1 2 3 5 8 13 a. Write number of operations as a function when the code is execute b If n 7, what is the total number of operations? c. What is the complexity of the algorithm behind the code? (2 Marks) (2 Marks) (1...
a) Define, in words the following 0 the humidity ratio in relative humidity (6 marks) ) dew point temperature b) Explain the principle of operation of a whirling hygrometer (sing psychrometer) (4 marks) ) Various psychrometric processes (0-1, 0-3,0-4,0-5) are shown in the figure below. Match the processes to the following: Cooling with dehumidification Sensible heating Humidification with steam injection Humidification with water injection (4 marks) d) On a particular day the weather forecast states that the dry bulb temperature...
Question 2 (a) Define algorithm and give an example to illustrate it. [5 marks] (b) The following C program codes are given below 1.#include <stdio.h> 2. main() char s 1-"Bad"; 6 7 char s1 -"weather!"; char sen [20]; int i, ji for (i-0;i<20: ++i) 10. sen [i]-s [i]; else 12. 13. 14. 15. 16. 17 18. 19 sen [i++ for ( j-o;s1 [j] !-'\0 ' ; j ++ , i++) sen [i]-s1 [j break; 20. 21 22. sen [il-'1o puts...
How to solve for b,c,d
The following table contains short-run average total cost data for 5 different plant sizes for the Stiller Co. company. Output Plant 1 Plant 2 Plant 3 Plant 4 Plant 5 Complete the following questions. a) Graph the short-run average total cost curves for the plants then sketch the long-run average total cost curve. Note: You must plot all of the points for each short-run average total cost curve to receive full marks. Long-run Average Total...