I am doing an online into to C++ programming class. I know I'm on the right track (ie, using the right tools) but the book I have is the wrong one and it's no help. This is the assignment:

"Create a class Rectangle. The class has private attributes length and width, each of which defaults to 1. It has member functions that calculate the perimeter and the area of the rectangle. It has set and get functions for both length and width.

The set functions (i.e. setLength() and setWidth()) should verify that length and width are larger than 0.0 and less than 20.0. If the parameter does not satisfy, use default value = 1.0

The get functions (i.e. getLength() and getWidth() ) should return the value of the attributes.

The constructor should use the set functions to initialize the attributes.

The following is main function you should use. The main idea is that, given three rectangles a, b and c, output their lengths, widths, perimeters and areas. Include header files when necessary."


I thought I knew how to do it, but for some reason I'm stumbling on... something. I just don't know what's going wrong, and I know it must be really basic. I'm pretty sure I'm missing something, but I'm not sure what to look up in a tutorial so I can fix what's wrong, you know?

Code:
//this is my coding

#include <iostream>


using namespace std;

class rectangle {
  private:
	int width, height;
  public:
    rectangle ();
    rectangle (int,int);
    int area (void) {return (x*y);
	int perimeter (void) {return (x*2 + y*2);}
	
};

rectangle::rectangle () //a tutorial online said that's how you set defaults
{
  x = 1;
  y = 1;
}

rectangle::rectangle (int x, int y) //derived from notes
{
  width = x;
  height = y;
}




//this is what was given
int main()
{
	Rectangle a, b(4.0,5.0), c(67.0, 888.0);
	cout<< setiosflags(ios::fixed | ios::showpoint);
	cout<<setprecision(1);

	cout<<"a: length = " << a.getLength() << "; width = " << a.getWidth()
                                            << "area = " << a.area() <<'\n';

	cout<< "b: length = " << b.getLength() << "; width = " << b.getWidth() 
                                                     << "; perimeter = " << b.perimeter()
                                                     << "; area = " << b.area() << '\n';

	cout << "c: length = " << c.getLenght() << "; width = " << c.getWidth() 
                                                      << "; perimeter =" << c.perimeter() 
                                                      << "; area = " << c.area() << endl;

	return 0;
}

//my coding again



int setWidth() //because it is based on a, b, and c, it is blank, right?
{
    if ((x < 0.0) || (x > 20.0)) 
	{
		x = 1.0;
	}
	Return x;
}
//have to use X and Y because Width and Height are private, right?
int setHeight() 
{
    if ((y < 0.0) || (y > 20.0))
    {
        y = 1.0;
    }
  return y;
}

When I compile, I get three errors:
"error C2535: '__thiscall rectangle::rectangle(void)' : member function already defined or declared"
(that one I get twice)

"fatal error C1004: unexpected end of file found
Error executing cl.exe."

This is of course due tonight (asking online was my last resort after trying to make it work on my own) and if someone can just tell me where I'm going wrong and how I should be doing it instead I'd appriciate it.