int userchoice;
//receiving input
cout<<"Press 1 for trapezium, 2 for triangle, 3 for rectangle, 4 for all objects and press enter"<<endl;
cin>>userchoice<<endl
switch(userchoice)
{
case 1:
//codes for calculating the area of trapezium
break;
case 2:
//codes for calculating the area of triangle
break;
case 3:
//codes for calculating the are of rectangle
break;
case 4:
//code for calculating the area of all objects
break;
default:
cout<<"You've selected an invalid object value"<<endl;
break;
}
IMO, I think the OP might have a legitimate right to complain here. Based on this line of the instructions:
write three user defined functions : calculate_trapezoid , calcluate_Hexagon , and Calculate_Triangle to solve the equations.
From what I read here he has to take input from the user to define the functions in his code. The only way I can think of to do that is to have a program prompt the user for input, dump the data to a .cpp file, then call an embedded compiler to link & build that new .cpp file to run the functions that the end user defined :D! That's all a bit much for a beginner!