CS 311 Fall 2009  >  Assignment 5

CS 311 Fall 2009
Assignment 5

Assignment 5 is due at 5 p.m. Thursday, November 5. It is worth 25 points.

Procedures

This is a group assignment. Please work in a group of 2 or 3. Each group only needs to turn in a single copy of the assignment. Under normal circumstances, each will receive the same grade on the assignment.

E-mail answers to the exercises below to ffggc@uaf.edu, using the subjectDA5”.

Exercises (25 pts total)

Exercise A — Templated Smart-Array Class

Purpose

In this exercise, you will write a class template that acts as a “smart array”. It will not be quite as good as std::vector, but it will be significantly better than KSArray, from Assignment 2; in particular, the array will be resizable. It will also be exception-safe and efficient.

Key to this assignment is exception safety. Make sure that exceptions thrown by value-type operations are properly handled, and that all safety guarantees are documented.

And as always, make your code high quality.

Instructions

Implement a C++ class template that manages and allows access to a resizable array. The type of items in the array should be specified by the client. Be sure to follow the coding standards. All standards now apply!

Test Program

I have written a test program: tsmarray_test.cpp. If you compile and run your package with this program (unmodified!), then it will test whether your package works properly.

Do not turn in tsmarray_test.cpp.

Reminders


CS 311 Fall 2009: Assignment 5 / Updated: 30 Oct 2009 / Glenn G. Chappell / ffggc@uaf.edu Valid HTML 4.01!