CS 2620 Assignment #4 Summer 2003

How to handin.
Points : 40
Weight : 3%
Due : Wednesday May 26, 2004 @11:00 PM
Note : Late assignments will be accepted only with the instructor's pre-approval.


Marks will be awarded for comments, style, readability, compiling and working correctly.
  1. [10] Classes.
    Convert the point library that you wrote in Assignment 2 to a class. You will, of course, need to convert the library functions to member functions. In addition, add the following :

  2. [20] You have shown your friend your point class. She is very impressed!! She is so excited and sees a good use for this class. You see, she creates dot to dot puzzles. Dot to dot puzzles consist of a list of an unknown number of points which, when joined together, create a picture.

    With her help, you have designed a dotToDot class which can be found in $L/dotToDot.design. You are to implement the dotToDot class following the design.

    Since you do not know how many points there will be in the puzzle, you will need to use a dynamic array of points as a data member. Of course, you realize as you implement the class, that, since it uses dynamic memory, you will need to provide a copy constructor, destructor and overload the assignment operator.

    Use the program puzzle.cc, found in $L/puzzle.cc, to test your class.

    You are not allowed to change this test program so study it carefully to ensure that you have called your class and functions by the correct names.

    You are NOT allowed to use a vector to implement this class, you must use a dynamic array.

  3. [10] Convert the term class found in $L/lect/may18/term by overloading all the arithmetic operators. Since the scalar multiply could now be written as double * term, you will need to provide a non-member overload for it as well.

    Modify the client program so that it makes use of the overloaded functions.


Assignment List | Prev | Next | Computer Science 2620
Department of Mathematics & Computer Science
University of Lethbridge Home Page