Hi all,
i was wondering if anyone could please help me out as i'm am struggling with programming. Our Lecturer has given us this assignment and i need help getting started. I'm asking on here because our lecturer isn't very helpful and doesn't explain things very well. (By the way i'm am a real novice at programming)
The start of the assignement is as follows:
Create a base class named ‘Quadrilateral’ that contains 4 float attributes (with a ‘protected’ access specifier) called side1, side2, side3, side4. The member functions (methods) must consist only of the following:
1. a four-argument constructor with default values of 1.0 for all attributes
2. a function area( ) to return a float value of ‘-1’ since the area is indeterminate.
3. a function perimeter( ) to return a float value, the sum of all four attributes.
4. a function getSide1( ) to return side1.
5. a function name( ) to return a char pointer (char*) initialized to “Quadrilateral”.
6. a destructor function.
Create a derived class named ‘Rectangle’ with public inheritance from Quadrilateral. The member functions (methods) must consist only of the following:
1. a two-argument constructor with default values of 1.0. The first argument is assigned to ‘side1’ and ‘side3’, the second argument is assigned to ‘side2’ and ‘side4’.
2. a function area( ) to return a type float from the product of size1 and size2.
3. a function name( ) to return a char pointer (char*) initialized to “Rectangle”.
4. a destructor function.
If any could please help i would really appreciate it
Thanks for your time
Mark.