Department of Computer Science

Problem Solving and Algorithm Design I

Spring Semester 2010

Dr. Maury Eggen

Examination Two Review

The topics for the second examination include, but are not necessarily limited to the following:

Problems on the examination will include programs and functions for you to write, programs and functions for you to read and debug. Problems will include things like you have seen before, things related to things you have seen before, and things you have never seen (but will be able to solve by applying your knowledge). Be aware that computer science is a cumulative discipline. Thus, everything from day one to right now is fair game on the exam. Be prepared to write lots of functions on the exam.

So that you may feel more comfortable about the volume of material this test covers you may bring a "cheat sheet" to the examination. You may prepare one 8 1/2 by 11 sheet of paper with any information on it you feel is important, ant may bring and use this sheet during the examination. Your sheet may be hand written or may be prepared on the computer. This is the only thing you may use on the exam. Book, notes, computer workstation are all closed during the test.

Sample Questions

1. Write a function which will reverse the elements of a list.

2. Write a function which will take an array a[] and a size n, and a value v as arguments, and will add v to each element of the array.

3. Write a function which will find and return the index of the maximum entry in an array.

4. Write a function which will create an array of positions where the maximum element of an array exists.

5. Write a function which will take two integers a and b as arguments (a less than b) and will write all of the integers between a and b to a file

6. Write a function which will generate n random integers between a and b and store them in an array.

7. Write a function which will return true if the value v is present in the array a[] exactly once.

8. Write a function which will count the number of vowels in a body of text.

9. Write a function which will find the mean of an array of floating point values. 10. Write a recursive function which will copy a file of numbers, increasing the value of each number by a value v.

10. Write a function which will find the difference between the largest and smallest values in an array

Return to the Computer Science 1320 Home Page
Return to Dr. Eggen's Home Page