MCS273 Introduction to C++ Programming (January 2013)

Integer point class


Overview

In this lab you will implement a class called IntPoint in two files IntPoint.h and IntPoint.hh, write a client program that tests the class, and write a makefile that compiles it together as described in class today. You may want to refresh your memory on using g++ and using makefiles.

Your programming task

  1. Create a new makefile project called IntPoint.

  2. Implement an class IntPoint that is identical to Horstmann's Point class as described on "ccc_win" reference, with two exceptions:

    • An IntPoint has integer coordinates.
    • An IntPoint won't be able to draw itself on cwin.

    You should have a header file with declarations in IntPoint.h and implementations in IntPoint.cc. You should also have a client program, perhaps called main.cc, that will test IntPoint. You may wish to refer to the project archived in MyString.zip, which we covered in class, as a reference.

  3. After you have created IntPoint.h, IntPoint.cc, and main.cc, copy the makefile in the MyString project into your project and change it so that it complies and links appropriately.

  4. Do your implementation of the IntPoint class and do your testing in main.cc.

  5. Check-offs (2 points): Don't forget to get checked off. I will check your Makefile, .cc and .h files, focusing on your documentation, testing, compilation, and execution.