C/IL 102 Spring 2008
Test #1 Answer Key (Section 4)

Note that below the answer key are discussions of problems on which a significant number of students gave incorrect answers.
 1. a       11. b       21. d       31. a       41. b
 2. b       12. c       22. e       32. c       42. c
 3. c       13. a       23. e       33. b       43. d
 4. a       14. e       24. b       34. d       44. a
 5. c       15. a       25. b       35. d       45. c
 6. c       16. d       26. b       36. c       46. c
 7. c       17. c       27. b       37. c       47. a
 8. c       18. b       28. a       38. d       48. c
 9. a       19. e       29. d       39. d       49. b
10. c       20. d       30. d       40. b       50. a

8. In the binary numeral 10110, there are 1's in the 2's, 4's, and 16's columns and 0's everywhere else. Hence, the number it represents is 2+4+16, which is 22.

10. Because main memory (RAM) is volatile, whatever is stored there (e.g., an MS Word document that you have edited in the last ten seconds) disappears if there is an electrical power outage (or your laptop's battery goes dead) or you are forced to reboot because the machine "hung" (i.e., became unresponsive).

11. With respect to files (stored in secondary storage), the term volatile is sometimes used to mean "frequently changing in content" (corresponding to choice (d)). But with respect to RAM, volatility refers to the property of its contents "disappearing" when there is an interruption of power.

12. ROM is used mostly to hold instructions that, when executed, initiate the "boot up" process. When you install software (either from the Web or a CD), the usual place to store the file(s) holding that software is on the hard disk.

14. This question asks about the relationship between primary memory and secondary storage. (a) is wrong because primary memory is more expensive (per byte). (b) is wrong because primary memory is used for short-term storage, not long-term. (c) is wrong because primary memory (almost always) has a smaller capacity. Obviously, then, (d) cannot be right, so (e) is the only choice left.

16. Floppy disks and flash memory are forms of secondary storage, and hence not volatile, which eliminates both (c) and (e). In comparison to hard disks, their storage capacities are low, so (a) is eliminated. Floppy disks are very slow, even in comparison to hard disks, so (b) is eliminated.

18. Auto-flush toilets were not mentioned in the videorecording, eliminating (d) and (e) as viable answers. (a) and (c) remain reasonable answers, but neither is right. You will notice that the correct answer is given in the third paragraph of the web page summarizing Giant Brains.

20-26. Look in the web page summarizing Giant Brains.

27-33. Look in the web page summarizing Paperback Computer. In particular, the main point of that videorecording is that computers have become household items because they have become small, inexpensive, and easy to use. (See question 32.)

37,39. See the web page on software and operating systems.

40. (b) is the answer, as interpreting and displaying web pages is what a web browser (e.g., Internet Explorer, Mozilla Firefox) does.

42. Many students answered (b), suggesting that they thought that the effect of ADD 5 was to add 5 to the accumulator (which already had the input value 2 in it) yielding 7.

But ADD 5 means to add the value in memory location 5 (here that would be 2, as the input value was stored there by STORE 5) to whatever value is in the accumulator. Hence, the result is 2+2, or 4.

In general, this program, given a value x as input, produces as output 2x.

43. This program, given x as input, produces as output 2x - 3.

44,45. If you got these right, you should consider becoming a computing major!

What the program does is to place the two inputs into memory locations 15 and 16, and then (in the loop in lines 4-11) subtract one from each of locations 15 and 16, repeating this until such time as location 16 has value zero.

For the inputs stipulated in problem 44, 5 and 2, what happens is that, on the loop's first iteration, the 5 (in location 15) becomes 4 and the 2 (in location 16) becomes 1. Then on the second iteration of the loop, the 4 becomes 3 and the 1 becomes 0. As location 16 has become zero, the loop terminates and the value in location 15, 3, is produced as output.

With inputs 42 and 20 (as stipulated in problem 45), the loop would iterate twenty times (as the 20 counted down to 0), on each iteration subtracting one from what had originally been 42. Subtracting 1 from 42 twenty times leaves 22.

In general, the program, given x and y as inputs, produces x - y as output.