Document last modified:
| Data Addr Variable 00 0 01 i 2 02 y 1 03 x 23 04 -4 05 9 06 2 07 z 7 08 n 4 |
![]() |
Give the Hypothetical Machine code for the following using data defined above. Assume each instruction execution is independent of the others.
- (1) y = y + z
- (1) z = z + 1
- (1) y = x[i]
- (1) z = x[1]
- (1) read z;
Complete the Hypothetical Machine code program by encoding the following algorithm part. Use the data part from above.
- (8) i = 0;
y = 0;
do {
read z;
y = y + z;
i++;
} while (i < n);
z = y / n;
print z;Data for read instruction:
3.5
2.4
7.8
1.3