//File: crect01.cpp
//Date: 02/11/2002
//Authors: Us
////////////////////////////////////////////////////////////
//Problem: define CRectangle class and some operations for it
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// includes
////////////////////////////////////////////////////////////
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
////////////////////////////////////////////////////////////
// constants
////////////////////////////////////////////////////////////
const int TEST_COUNT = 5;
////////////////////////////////////////////////////////////
// class TRectangle definition
////////////////////////////////////////////////////////////
class CRectangle
{
private:
int m_length;
int m_width;
public:
int getLength(void);
CRectangle(void);
};
void main(void)
{
CRectangle r1;
cout << r1.getLength() << endl;
}
int CRectangle::getLength(void)
{
return m_length;
};
CRectangle::CRectangle(void)
{
m_length=1;
m_width=1;
}
|