I have a problem to solve a problem

The main idea: I have to creat an abstract class named Triangle using virtual functions for calculating the area and the perimeter of the triangle.Also the main information should include the length of the two side of the triangle and the angle between them.Also I should derivate some classes showing that triangle is simple,equilateral,isoscel,rectangle and so on.Help me please !
Last edited on
Please...
Do you know how to make a class?
yes
So make one, named Triangle.

Then you need to put virtual functions in it for calculating the area and the perimeter of the triangle. Do you know how to put virtual functions in a class?
No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Shapes
{
    virtual  void Area() = 0 ; 
    ..........................
   ............................  
};

class Traingle : public Shapes
{
   void Area( ) ; 
};

class Circle : public Shapes
{
  void Area();
}


Hopes this helps
How about non-virtual functions? Can you put those in a class?
Moschops let Basota try it for non virtual function .
write it for me please
Topic archived. No new replies allowed.