Title: Discussion
1Schedule
2Ask
- Alma 526
- 26 And now behold, I say unto you, my brethren,
if ye have experienced a change of heart, and if
ye have felt to sing the song of redeeming love,
I would ask, can ye feel so now?
3Exam II
- 31 July 1 August (Tue Wed) in Testing Center
- 100 questions
- Chapters 9 through 15
- Good idea to have scratch paper on hand
- Study slides
- Study homework
- Study book
4Exam II Review
5Exam II Review
1. Explain how each of the following data
structures operates a. FIFO b. LIFO c. Random
Access d. Stack 2. What are the differences
between high-level and low-level
languages? 3. What are the differences between a
interpreter and a compiler?
6Exam II Review
4. What are a pre-processor and linker used
for? 5. What is the difference between syntax
and semantics? 6. What does a C program look like
and how does it function? 7. What are valid C
labels? 8. What is the difference between local
and global variables?
7Exam II Review
- 9. How big of a number can be stored in an
- a. int?
- b. short int?
- c. unsigned int?
- d. char?
- e. float?
- f. double?
- 10. What is the difference between logical
operators and bit-wise operators? - 11. What is operator precedence used for and
which operators bind the tightest? - 12. How is variable scope determined?
8Exam II Review
13. What does the following LC-3 function
do? START add r6, r6, -2 str r2, r6,
0 str r3, r6, 1 and r0, r0, 0 and r3, r3,
0 add r2, r2, 0 brzp L02 not r2,
r2 add r2, r2, 1 add r3, r3, -1 L02 add r2,
r2, 0 brz L04 add r2, r2, -1 add r0, r0,
r1 brnzp L02 L04 add r3, r3, 0
brz L06 not r0, r0 add r0, r0, 1 L06 ldr r2,
r6, 0 ldr r3, r6, 1 add r6, r6, 2 ret
9Exam II Review
- 14. How many iterations will a while loop
perform? - 15. A switch decision is based on what types of
variables? - 16. What is considered a Boolean true value?
- 17. What purpose does a function declaration
serve? - 18. How does one exit from a do-while construct?
- 19. What would be functionally equivalent to a
switch statement? - 20. When is the default case executed?
10Exam II Review
- 21. What does ( !( x 1 ) ) evaluate to?
- 22. What kind of errors are caught by the
compiler? - 23. What does the reserved word break do?
-
11Exam II Review
- 24. What is printed to the output?
int x 4 main() int y x int x 15
int i 0 for (i 0 i int x i printf(d d\n, x, y)
printf(d d\n, x, y)
12Exam II Review
- 24. What is printed to the output?
int x 4 main() int y x int x 15
int i 0 for (i 0 i int x i printf(d d\n, x, y)
printf(d d\n, x, y)
0 4 1 4 2 4 3 4 15 4
13Exam II Review
- 25. What is printed to the output?
int x main() int y x int x 2
int x 3 funct(x) printf(d d\n,
x, y) printf(d d\n, x, y)
void funct(int x) printf(d\n, x) x
4
14Exam II Review
- 25. What is printed to the output?
int x main() int y x int x 2
int x 3 funct(x) printf(d d\n,
x, y) printf(d d\n, x, y)
void funct(int x) printf(d\n, x) x
4
3 3 0 2 0