Rectangle Problem

Need help with the following problem:

Create a class that represents a geometric rectangle shape. The shape should be defined by a point for the upper left corner and the width and height. Also define a member function that determines if a point parameter is inside or on the edge of the rectangle by returning true or false.

Well? Maybe start with "Create a class."
How so? I am a beginner at this stuff....
Here ya go.
http://cplusplus.com/doc/tutorial/classes/

-Albatross

EDIT: Hehehe.
Last edited on
Last edited on
This is what I have so far:

int main ()
{
class CRectangle
{
private:
double height;
double weight;
bool param;
}
Classes are to be defined outside of main, sorry.

-Albatross
Ok..thanks...so what should go inside the main class?
In theory, nothing should or shouldn't go inside the main function besides return 0;. It seems like this problem only requires you to create the class.

-Albatross
ok...what is the next step?
Why, my dear friend, the next step is to read the next paragraph of the tutorial. :)

-Albatross
what about the boolean parameter?
Read the tutorial.
http://cplusplus.com/doc/tutorial/

Create a class that represents a geometric rectangle shape. The shape should be defined by a point for the upper left corner and the width and height. Also define a member function that determines if a point parameter is inside or on the edge of the rectangle by returning true or false.
Last edited on
Topic archived. No new replies allowed.