Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
 
 

What's inside.

Ta Email

Download Compiler

Final Project

Lab Notes

Office Hours

Schedule

Syllabus

Announcements

Check Grades

 

CSci 1113 Home

 
 

Printer-friendly version

 
Lab Midterm Review - Spring 2009

The lab midterm will cover Chapters 1-5 and 12 in the Savitch text.  See the Midterm review document for the programming related material you should be familiar with from Chapters 1 - 2. 

Chapters 3 & 4 - Functions

You will be asked to write a function to do some task.  You will have to provide the function's declaration, header, definition (header + body), and call.

Know the difference between parameters and arguments and their relationship.  Know what it means to call-by-value and to call-by-reference using reference parameters.  Know how to use the return statement to pass a value back to the calling program.

You should be able to define (and use, if appropriate) the following terms: global variable, local variable, scope.

Chapter 12 (12.1 and 12.2) - File I/O

I/O file streams and data files. Be able to use ifstream and ofstream objects to read and write data to a file. Know the open(), close(), fail() and eof() functions. Also, know the different ways to determine the number of records in a data file: 1) including this number as the first entry in the file, 2) using a sentinel as the last entry, and 3) checking for the end-of-file mark.

Chapter 5 - Arrays

One Dimensional Arrays

Know how to declare and initialize one-dimensional arrays, e.g.,

       const int ITEMS = 4;
    double temperature[ITEMS] = {99.1, 98.3, 94.6, 95.5};

Know how to use array subscripts (e.g., temperature[i]), especially in a loop.

Know how to pass an array to a function.  Remember, use the array name in the function call, along with the size of the array:

        max = maxi( temperature, ITEMS); // call

Also remember that the function must know if a parameter is an array - use [] to indicate it:

       double maxi(double temp [], int SIZE)  // header

Know what a "partially filled arry" is and how to use it.

Two-Dimensional Arrays and Matrices

Know how to declare and initialize two dimensional arrays.

Know how to pass 2D arrays to functions.  Remember that the number of column elements must be provided:

    void display( double temp[][limit], int nrows, int ncols)

Matrices are 2D arrays, of course, so know how to use them.  You do not need to memorize the matrix multiply algorithm.

 
The University of Minnesota is an equal opportunity educator and employer.
CSci 1113: C++ Programming