CS 60, Fall 2009
Assignment 5

This project incorporates three exercises from the Nagler text [shown in brackets below]. To the extent that instructions here differ from the text, these instructions take precedence. Copies of necessary files are available in ~cs60/hw5/, including executable versions of test programs. Your results must exactly match the results of those solutions.

Remember to type your name and the date at the beginning of all files to be turned in.

Due: Thursday, December 3, 9:00 pm
Worth: 100 homework points

  1. [See Nagler exercise 10.3, pp. 285-6] Write fraction.h to include all of the features listed at the top of page 286, plus two extra ctors noted below.
  2. [Continue exercise 10.3] Write fraction.cpp to implement class Fraction. Test your implementation with testfraction.cpp. Insure that results exactly match the solution's results.
  3. [See Nagler exercise 12.2, p. 342] Write highest.h to contain just the one function template described in the exercise. Zero credit will be awarded for this part if you write overloaded functions (for int, double, and char data) instead of the template. Test it with testhighest.cpp. Match the solution's results.
  4. [See Nagler exercise 12.7, pp. 397-8] Write primitive.h as a class template.
  5. Turn in four files:
    turnin hw5@cs60 fraction.h fraction.cpp highest.h primitive.h
    Late projects may not be accepted.

Updated 11/19/09 by C. Michael Costanzo