Create Shape abstract class:
a. Contain member variable name
b. One Argument constructor
c. Area() pure virtual function
d. Perimeter() pure virtual function
e. Display() pure virtual function
f. Should create Shape.h, Shape.cpp files for this class
Create Triangle class Inherit from Shape:
a. Contain two edge member variables named a, b
b. Contain one Point member variable which is the vertex between a, b
c. Contain one double degree which is the angle between a, b
d. Write one default constructor
e. Write four arguments constructor, which takes two edges, one point, and one double for degree
f. Should create Triangle.h, Triangle.cpp files for this class
Create Rectangle class Inherit from Shape:
a. Contain one Point member variable which is the vertex of the bottom left corner
b. Contain two edge member variables named width, height
c. Write one default constructor
d. Write three arguments constructor, which takes one point, and two doubles
e. Should create Rectangle.h, Rectangle.cpp files for this class
Create Circle class Inherit from Shape:
a. Contain one Point member variable which is the center of the circle
b. Contain one double member variable which is the radius of the circle
c. Write one default constructor
d. Write two arguments constructor, which takes one point, and one double for radius
e. Should create Circle.h, Circle.cpp files for this class
Create a Point class:
a. Contain two double member variables which represent x and y coordinates
b. Mutator and accessor of x, y
c. Should create Point.h, Point.cpp files for this class
Create an Edge class:
a. Contain one double member variable which represents the length of the edge
b. Mutator and accessor of length
c. Should create Edge.h, Edge.cpp files for this class
Due date: May 3, 11:59 PM
The DynamicArray class is as follows:
Complete DynamicArray class.
Write a function called CreateDynamicShapeArray(filename), which takes a filename containing information of Shape. Then return a dynamic array of Shape. (Write in the main.cpp)
1. Create Shape abstract class:
a. Contain member variable name
b. One Argument constructor
c. Area() pure virtual function
d. Perimeter() pure virtual function
e. Display() pure virtual function
f. Should create Shape.h, Shape.cpp files for this class
2. Create Triangle class Inherit from Shape:
a. Contain two edge member variables named a, b
b. Contain one Point member variable which is the vertex between a, b
c. Contain one double degree which is the angle between a, b
d. Write one default constructor
e. Write four arguments constructor, which takes two edges, one point, and one double for degree
f. Should create Triangle.h, Triangle.cpp files for this class
3. Create Rectangle class Inherit from Shape:
a. Contain one Point member variable which is the vertex of the bottom left corner
b. Contain two edge member variables named width, height
c. Write one default constructor
d. Write three arguments constructor, which takes one point, and two doubles
e. Should create Rectangle.h, Rectangle.cpp files for this class
4. Create Circle class Inherit from Shape:
a. Contain one Point member variable which is the center of the circle
b. Contain one double member variable which is the radius of the circle
c. Write one default constructor
d. Write two arguments constructor, which takes one point, and one double for radius
e. Should create Circle.h, Circle.cpp files for this class
5. Create a Point class:
a. Contain two double member variables which represent x and y coordinates
b. Mutator and accessor of x, y
c. Should create Point.h, Point.cpp files for this class
6. Create an Edge class:
a. Contain one double member variable which represents the length of the edge
b. Mutator and accessor of length
c. Should create Edge.h, Edge.cpp files for this class
Due date: May 3, 11:59 PM
7. The DynamicArray class is as follows:
template<class T> class DynamicArray {
public:
DynamicArray(int s); // copy constructor
DynamicArray(const DynamicArray& d); // destructor
~DynamicArray();
DynamicArray<T>& operator=(const DynamicArray& d);
int getCapacity() const;
int getNumElements() const;
T& operator[](int index);
void add(T &e);
private:
T *p;
int capacity;
int numElements;
};
Complete DynamicArray class
8. Write a function called CreateDynamicShapeArray(filename), which takes a filename containing information of Shape. Then return a dynamic array of Shape. (Write in the main.cpp)