Q) Write a C++ program, which contains an abstract class called Polygon that should be defined as illustrated in the following class diagram. The member function displaySides() is a pure virtual function that should display the sides values for the shapes in each derived classes. The two classes Rectangle and Triangle are derived from the class Polygon and they to be defined as illustrated in the following class diagram.
In the main function, implement the following processes:
? Create the object R (4, 6) from the class Rectangle.
? Create the object T (4, 7, 9) from the class Triangle.
? Display the sides' values for the triangle T.
(10 marks)
Polygon
#firstSide: int
#secondSide:int
+parametrized constructor
+displaySides():void
Rectangle
+parametrized constructor
Triangle
-thirdSide: int
+parametrized constructor