I'm trying to implement a menu choice, so the user can define what kind of triangle they have, with the focus on class implementation.
I'm trying to define a class attribute that offers the choices, but then depending on the choice, sends the compiler to the appropriate attribute.
Example:
int Triangle::CalcDecider(int choice1)
{
if (choice1 == 1)
{
Cool.Equilateral();
}
//Additional code choices
}
Where Triangle is the class, CalcDecider is the function, and Cool is the object I created.
Should I scrap this idea and use a switch instead? I've never used a switch before, but it was recommended that I follow that route.
Is it even possible to follow the route I'm taking?