Hi i am trying to think of how the algorithm of how this question works but no matter how hard i tried, i cant think of it. Can anyone give me a hand?? Any help or tip would be greatly appreciated.

Question:

Given 3 classes, equilateral triangle, isosceles triangle and right-angled

triangle, find the relationship in terms of inheritance among them and a

generic triangle class. Define each class’s data members and member

functions, making clear which are mutator, accessor, or virtual functions.

Write functions to calculate area and perimeter, sharing code as much as

possible.