#include <iostream>
class Point
{public:
void SetX(int x) {itsX = x;}
void SetY(int y) {itsY = y;}
int GetX()const {return itsX;}
int GetY()const {return itsY;}
private:
int itsX;
int itsY;
};
class Rectangle
{ public:
Rectangle (int top, int left, int right, int bottom);
~Rectangle () {}
int GetTop() const { return itsTop; }
int GetLeft() const{return itsLeft;}
int GetBottom() const{return itsBottom;}
int GetRight() const{return itsRight;}
Point GetUpperLeft() const {return itsUpperLeft;}
Point GetUpperRight() const {return itsUpperRight;}
Point GetLowerLeft() const {return itsLowerLeft;}
Point GetLowerRight() const {return itsLowerRight;}
void SetUpperLeft (Point Location) {itsUpperLeft = Location;}
void SetUpperRight(Point Location) {itsUpperRight = Location;}
void SetLowerLeft (Point Location) {itsLowerLeft = Location;}
void SetLowerRight (Point Location) {itsLowerRight = Location;}
void SetTop (int top) {itsTop = top;}
void SetLeft (int left) {itsLeft = left;)
void SetRight (int right) {itsRight = right;}
void SetBottom (int bottom) {itsBottom = bottom;} \
int GetArea() const;
private:
Point itsUpperLeft;
Point itsUpperRight;
Point itsLowerLeft;
Point itsLowerRight;
int itsTop;
int itsBottom;
int itsLeft;
int itsRight;
char response;
cin >> response;
return 0;
};
This should work, but it doesn't.
The errors I get are these:
[C++ Error] rectangle.cpp(18): E2451 Undefined symbol 'itsTop'
[C++ Error] rectangle.cpp(19): E2451 Undefined symbol 'itsLeft'
[C++ Error] rectangle.cpp(20): E2451 Undefined symbol 'itsBottom'
[C++ Error] rectangle.cpp(21): E2451 Undefined symbol 'itsRight'
[C++ Error] rectangle.cpp(23): E2451 Undefined symbol 'itsUpperLeft'
[C++ Error] rectangle.cpp(24): E2451 Undefined symbol 'itsUpperRight'
[C++ Error] rectangle.cpp(25): E2451 Undefined symbol 'itsLowerLeft'
[C++ Error] rectangle.cpp(26): E2451 Undefined symbol 'itsLowerRight'
[C++ Error] rectangle.cpp(28): E2451 Undefined symbol 'itsUpperLeft'
[C++ Error] rectangle.cpp(29): E2451 Undefined symbol 'itsUpperRight'
[C++ Error] rectangle.cpp(30): E2451 Undefined symbol 'itsLowerLeft'
[C++ Error] rectangle.cpp(31): E2451 Undefined symbol 'itsLowerRight'
[C++ Error] rectangle.cpp(33): E2451 Undefined symbol 'itsTop'
[C++ Error] rectangle.cpp(34): E2451 Undefined symbol 'itsLeft'
WUT R WRONG :(
what were you doing to get this? :|
Quote from: WiiGuy on October 18, 2007, 11:12:24 AM
what were you doing to get this? :|
Uh, taking my programming class?
sry can't help :(
why you unlocked this? :P
Quote from: blue_slime on October 18, 2007, 11:49:05 AM
why you unlocked this? :P
I choose to agree with this post that I have just now quoted.
Quote from: blue_slime on October 18, 2007, 11:49:05 AM
why you unlocked this? :P
Because I need more C++ help. :(
Personally, I haven't done C++, but did your Point class compile properly? Your data members seem to be defined incorrectly as the error suggests.
Quote from: blue_slime on October 18, 2007, 12:08:18 PM
Personally, I haven't done C++, but did your Point class compile properly? Your data members seem to be defined incorrectly as the error suggests.
Hm...ah, I figured it out. A ( was supposed to be a {. :P
Quote from: Silverhawk79 on October 18, 2007, 12:08:56 PM
Quote from: blue_slime on October 18, 2007, 12:08:18 PM
Personally, I haven't done C++, but did your Point class compile properly? Your data members seem to be defined incorrectly as the error suggests.
Hm...ah, I figured it out. A ( was supposed to be a {. :P
Lol I hate those kinds of mistakes
lol, C++.
don't worry. you'll move on to C# next year and have to re-learn everything. :D