The third exam of the semester will be Tuesday, May 11, 2010, during our scheduled final examination time, 3:30-6:30pm. This is an exam just like the previous exams, with emphasis on the last third of the semester.
The topics for the third examination include, but are not necessarily limited to the following:
Make sure you know the syntax for fread(), fwrite(), fseek(), etc. These will surely be on the third exam.
Problems will include programs and functions for you to read, analyze and debug, programs and functions for you to write.
Problems will include things you have seen before, things like what you have seen before, and things you have never seen before. You must analyze, abstract, synthesize and apply your knowledge.
Please be aware that computer science is a cumulative discipline, so I can not guarantee that material from very early in the semester will not be on the exam.
Problems on the examination will include some definitions, fill in the blanks, true and false, short answer. Problems will also include studying and correcting code I write, as well as coding problems you will write. Make sure you can write short complete C programs.
Sample Questions:
1. A direct access file called "stuff" is in your active directory. Write a function which will determine how many records of type Record are in the file.
2. An unsorted list of integers a[] of size n elements has been filled with values. Write a sequential search routine which will search through the array for a value v, returning the index of v in a[] if found or -1 if v is not in a[].
3. A sorted list of integers a[] of size n elements has been filled with values. Write a binary search routine which will search the sorted list for a value v, returning the index of v in a[] if found or -1 if not found.
4. Consider the following record structure:
typedef struct { char name[20]; int age; } Person;
5. Write code which will determine whether or not a file of integers exists. If it exists, read it and fill an array with its values. If it does not, create it and write 100 random values between 0 and 99 inclusive out to the file.
6. A binary file lives in your directory. It contains a collection of records of the above type. Write code which will directly read the last record and print it.
7. A complex number a+bi can be thought of as an ordered pair of real numbers. Write a program which will model complex number arithmetic using a struct, as in the following
typedef struct { double realpart; double imagpart; } Complex;
8. A rational number (fraction) can be thought of as an ordered pair of integers (a,b) with b != 0. Model rational number aritmetic using a struct, as in the following
typedef struct { int numerator; int denominator; } Rational;
Return to the Computer Science 1320 Home Page
Return to Dr. Eggen's Home Page