I'll start by pointing out this obvious error:
Code:
cin >> "Please select 1-5: " >> selection;
This cannot happen. Cin is supposed to 'read' the user's input. Cout is what the console prints so I'd change it to this.
Code:
cout<<"Please select 1-5";
cin>>selection;
As for the following code:
Code:
void showMenu (int &);
That's a function prototype.
When you define a function after your main code, then you must have a prototype before the main code so it can know it has been defined later on.
It should have the following structure:
Code:
void showMenu(int &) //<--- Prototype
int main()
{
showMenu(int &)
(.........);
}
void showMenu(int &) //<-- Your function defined
{
(.....);
}
OR
Code:
void showMenu(int &) //<-- The function has been defined before main so prototype is not required
{
(.......);
}
int main()
{
showMenu(int &);
(...........);
}
If I was you I'd make a function for each option. One to compute a rectangle area, another for a circle area etc and then call each one of them depending on the user input (1-5).