NAME (1pt): _________________________    SEC (1pt):    1    2    3    4    

1) (1pt) In order to interact with a file, what must be associated with it?

  1. file handle
  2. file pointer    <== 
  3. data buffer
  4. I/O stream

2) (1pt) When opening a file, what two arguments must be supplied to  fopen()?

  1. file name, access mode    <== 
  2. file name, file location
  3. access mode, file size
  4. file name, file size

3) (3pts) What are the three common file structures as far as controlling how the program determines how much data to read from a file?

Counter (header) controlled, sentinel (trailer) controlled, end-of-file (eof) controlled.

4) (1pt) While covered in the book, it is very important (some would argue critical) that the success of every fopen() call be verified before any attempt to access the file, for reading or writing, is made. How can this be done?

By checking fopen() for a NULL return value

5) (1pt) Of the following, which is the best description of linear regression?

  1. A means of finding the straight line that exactly matches all of the data in a data set.
  2. A means of determining the y-value corresponding to an x-value between two known data points.
  3. A means of finding the straight line that, overall, provides the best fit to a given data set.   <== 
  4. A means of generating a data file having a large number of linearly related data points.

6) (1pt) Which of the following is not an advantage and/or goal of using the principle of modularity in your programs?

  1. Execution speed can be greatly enhanced because any one module is only performing a fraction of the entire program.   <== 
  2. Code can be developed, tested, and debugged in small, easier to manage pieces.
  3. Code that performs common tasks can be reused easily either within a single program or across multiple programs.
  4. The "divide-and-conquer" approach to problem solving can be facilitated because various parts of a problem can be assigned to different people and developed in parallel.