Lab 9: Instructor's Notes


This exercise introduces students to the vector as a means of storing and processing sequences of values. Since the vector is a part of the standard template library, the exercise assumes that you have STL properly installed on your system. Since a C++ vector is a template, this exercise introduces students to the use of C++ templates.

The exercise consists of reading a sequence of student names and their averages from a file into vectors, so that the averages can be easily processed. The 'processing' consists of computing the mean and standard deviation of the averages, and then computing the letter grade for each student's average, using the "curve" method of grading. The exercise thus introduces students to the pitfalls of "grading on the curve" as well as vectors and templates.

A skeleton program is provided in grades.cpp. Since some of the operations we will be creating are reuseable, we store them in a library, consisting of the header file DoubleVectorOps.h, the implementation file DoubleVectorOps.cpp, and the documentation file DoubleVectorOps.doc. A Makefile is also provided. Sample data files are provided in scores1.data, scores2.data, and scores3.data. If you wish to avoid network contention, save local copies of these files ahead of time, and instruct your students in how to copy them.


Back to This Lab's Home Page

Forward to the Prelab Questions


Copyright 1998 by Joel C. Adams. All rights reserved.