Project 02
Home ] Up ]

 

CSIS 250 Fall 2000 Project #2

 

Date Assigned

September 18, 2000

Date Due

September 27, 2000

Develop the CPoint class and test functions as discussed during the lectures.

Submit the well-documented printed source code and sample output.  Provide at least five test cases for each function.  Clearly show the operands and the results from each function.  Also complete and submit the following self-evaluation table. 

SELF-EVALUATION SHEET

Function

Well Documented Working Functions

Test Functions with Properly Labeled Sample Runs

 

Max Score

Your Score

Max Score

Your Score

CPoint (int a=0, int b=0);

2

 

2

 

CPoint (char ch);

2

 

2

 

void display(void) const;

2

 

2

 

void setX (int a);

2

 

2

 

void setY (int b);

2

 

2

 

void setXY (int a, int b);

2

 

2

 

int getX(void) const;

2

 

2

 

int getY(void) const;

2

 

2

 

void getXY (int &a, int &b) const;

2

 

2

 

void copyTo (CPoint &p) const;

2

 

2

 

void copyFrom (const CPoint &p);

2

 

2

 

bool isEqualTo (const CPoint &p) const;

24

 

24

 

Total Score

48

 

Use the following class definition:

//class definition

////////////////////////////////////////////////////////////

class CPoint

  {

  private:

    int x;

    int y;

  public:

    CPoint (int a=0, int b=0);

    CPoint (char ch);

    void display(void) const;

    void setX (int a);

    void setY (int b);

    void setXY (int a, int b);

    int getX(void) const;

    int getY(void) const;

    void getXY (int &a, int &b) const;

    void copyTo (CPoint &p) const;

    void copyFrom (const CPoint &p);

    bool isEqualTo (const CPoint &p) const;

  };