#include <iostream>
int menu();
void DoTaskOne();
void DoTaskMany(int);
using namespace std;
int main()
{
bool exit = false;
for ( ; ; )
{
int choice = menu();
switch(choice)
{
case(1):
DoTaskOne();
break;
case(2):
DoTaskMany(2);
break;
case(3):
DoTaskMany(3);
break;
case(4):
continue;
break;
case(5):
exit = true;
break;
default:
cout << " pls select again " << endl;
}
if( exit == true)
break;
}
return 0;
}
int menu()
{
int choice;
cout << " ******menu******" << endl <<endl;
cout << "(1) choice one " <<endl;
cout << "(2) choice two " <<endl;
cout << "(3) choice three " <<endl;
cout << "(4) Redisplay menu" <<endl;
cout << "(5) Quit " <<endl;
cout << ":";
cin >> choice;
return choice;
}
void DoTaskOne()
{
cout << "Task One" << endl;
}
void DoTaskMany(int which)
{
if(which == 2)
cout << "Task Two" << endl;
else
cout << "Task Three " << endl;
}