Start learning about object oriented(OO) concepts like polymorphism and inheritance. You can practice both using the following exercise.
Consider a list that can store multiple types of shapes.
Using this
one list, store a square, triangle and circle. Iterate over that list and print out the area and name of each shape.
Example pseudocode of populating such a list might be
PHP Code:
List<Shape> shapes = List;
shapes.add( Circle( x, y, radius ) )
shapes.add( square( x1, y1, x2, y2, x3, y3, x4, y4) )
shapes.add( triangle( x1, y1, x2, y2, x3, y3 ) )
To demonstrate an understanding of inheritance in this exercise, have both the triangle and square object extend a polygon object.
You can use this formula for the area:
Some links to get you started result from some simple google searches:
http://www.tutorialspoint.com/cplusp...nheritance.htm
http://stackoverflow.com/questions/2...l-methods-in-c
If this exercise seems a bit daunting, other nice features to look at include generics(templates) and operator overloads.