Question: Show all your work. 1. Convert the following binary number to its decimal form: 1010.101 2. Convert the following binary integer using the Homer's method:

Show all your work. 1. Convert the following binary number to its decimal form: 1010.101 2. Convert the following binary integer using the Homer's method: 101010 3. Convert the following decimal number to binary: 4.1875 4. Convert the following decimal number to binary using the subtraction method: 120 5. Assume a short(int) is stored in 2 bytes, a long(int) is stored in 4 bytes. a. How many bytes are allocated by the declaration of each array? short a[9]; long b[250]; short t[8][7]; b. If the starting address of the array a is 500, what is the address of a[7]? c. If the starting address of array bis 1210, which array element is located at address 1294? d. If the starting address of t is 100 and storage is row major order, what is the address of t[3][2]? 6. Given the input stream KLMNPQR. What sequence of pop and push operations will produce the output MNQPLRK? 7. Convert each of the following postfix expressions to infix. a. AB/CD/ ABC/D/ 8. Convert each of the following infix expressions to postfix(where $ stands for exponentiation) a. (A-B)*(D/E) b. (A + B $D/(E-F) +G 9. In the following exercise, assume a = 7.0, b = 4.0, c = 3.0, and d= -2.0. Evaluate the postfix expressions: a. abc-d- b. abcd--- 10. Consider the following expression P, written in postfix notation: P: 12.7.3. -, 7, 2, 1, 5, +, a. Convert Pinto its equivalent infix expression b. Evaluate the infix expression 11. What is the output from the following sequence of stack operations? Stack S; int x-3, y = 8; S.push(9); S.push(x): S.push(y); xS.popO; y=S.popo: println(y): S.push(22); while(!S.StackEmpty) y=S.popO; println(y): println(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
