Digital Music Programming

Mid-term Exam (Fujinaga, Spring, 1997)

Write your answers in the blue exam booklet. Return this exam.

1. What is a stack? Explain how it is used in C function calls. (5 pnts)

2. What is the difference between a binary file and a text file. (5 pnts)

3. What is the maximum number of comparison a sequential search and a binary search would need to determine that a particular item is not in a sorted list of 10 items, 100 items, and 1000 items. (5 pnts)

4. Write a function that returns via structure (or a pointer to a structure), the number of lines, the number of words, and the number of characters (non-white), given a file pointer. Write a main() that opens a file, calls the above function and prints the result. (15 pnts).

5. During a murder investigation, the following code was found on the victim's computer. Completely decode it find out "who dunnit!" (10 pnts)

4d 54 68 64 00 00 00 06

00 00 00 01 04 00 4d 54

72 6b 00 00 00 1e 00 ff

58 04 04 02 18 08 00 ff

59 02 00 00 00 ff 51 03

09 89 68 00 90 47 40 88

00 80 47 00 00 ff 01 49

63 68 20 64 69 64 20 69

74 00 ff 2f 00