Question 3] Answer the following clearly, showing neat working: a) unsigned x(3)
ID: 3904552 • Letter: Q
Question
Question 3] Answer the following clearly, showing neat working: a) unsigned x(3)(3)-((42, 39, 18), {91,34,56), {2, 17, 27); Y and Z are floating-p oint type. Y ((X[2][2]+) [1][ ]tX[0][1])"X[2][0]); Z-t [2][0] [11])"X[O][O]); what and Z values? are Y .b)in c++ int and double square functions have been defined. variables have been declared prope In the functional c++ code, statement Q square(square(3.2)); What type is ( int, double, char, Unsigned, none of these (which)? What is the value of Q? .b) Q type Q value. .c) Can the class be declared after the main program in C++ (yes, no, some-times); Why or why not? .c) Ans- -__ Reason- .d) Inline functions in C++, allow function code to be substituted in the stack (yes, no, sometimes) d Ans .e) Using structures and bitwise binary representation, how many minimum number of bits needed to represent 104 cards consisting of two decks.[4 bits,s bits,7 bits, none of these(how many)] .e Ans .f) In Java, variables can be declared anywhere in the program code. [yes, no, some-times, does not matter]? why?Explanation / Answer
1. Y = 209.00, Z = 1640.00
Explanation:
Y = X[2][2] + X[1][0] * X[2][0] = 27 + 91 * 2; According to bodmas rule answer = 209
Z = X[2][0] + X[0][1] * X[0][0] = 2 + 39 * 42; According to bodmas rule answer = 1640
2. Q type = float; Q value = 10485.76
square(x) function returns x*x; square(square(x)) = x^4; Therefore 3.2^4 = 10485.76
3. No; Reason: The compiler has to see the definition of the class before it can use it.
4. Yes; inline function in c++ allow function code to be substitued in the stack
5. 7 bits: 2^7 = 128; greater than 104;
6. Yes; In java varaible can be declared anywhere in the program
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.