GBONGIOVANO
Programmer
I have a menu with selections 1-9.
However I would like a Q or q for quit.
How do I do this with my variable makeChoice as an int
my code below thanls
g
void simulatorMenu()
{
int makeChoice;
cout << "\n\n\n\t\t\t Please Make A Choice \n";
cout << "\n\n\n\t\t [1] To Add a Node to the Network \n";
cout << "\n\t\t [2] To Delete a Node from the Network \n";
cout << "\n\t\t [3] To Add Link Between Two Nodes \n";
cout << "\n\t\t [4] To Remove th Link Between Two Nodes\n";
cout << "\n\t\t [5] To Add a Process ID to the Node ID \n";
cout << "\n\t\t [6] To Add a Child Process ID to Parent and Node ID(s) \n";
cout << "\n\t\t [7] To Remove a Child Process \n";
cout << "\n\t\t [8] To Remove a Parent Process \n";
cout << "\n\t\t [9] To View How many Nodes are on the Network \n";
cout << "\n\t\t [Q] or [q] to Quit the Programme \n";
cin >> makeChoice;
system("cls"
switch(makeChoice)
{
case 1:
//cout << "Add Node to Network" << endl;
return(addNode());
break;
case 2:
return (notYet());
break;
case 3:
return (notYet());
break;
case 4:
return (notYet());
break;
case 5:
return (notYet());
break;
case 6:
return (notYet());
break;
case 7:
return (notYet());
break;
case 8:
return (notYet());
break;
case 9:
return (notYet());
break;
/* Comments for debugging
case 'Q':
case 'q':
//cout << "n\ Test \n";
return (copyRight());
break;
//default:
// cout << " Please Follow Menu Instructions \n";
// system("cls"
//return simulatorMenu();
*/
}
return simulatorMenu();
However I would like a Q or q for quit.
How do I do this with my variable makeChoice as an int
my code below thanls
g
void simulatorMenu()
{
int makeChoice;
cout << "\n\n\n\t\t\t Please Make A Choice \n";
cout << "\n\n\n\t\t [1] To Add a Node to the Network \n";
cout << "\n\t\t [2] To Delete a Node from the Network \n";
cout << "\n\t\t [3] To Add Link Between Two Nodes \n";
cout << "\n\t\t [4] To Remove th Link Between Two Nodes\n";
cout << "\n\t\t [5] To Add a Process ID to the Node ID \n";
cout << "\n\t\t [6] To Add a Child Process ID to Parent and Node ID(s) \n";
cout << "\n\t\t [7] To Remove a Child Process \n";
cout << "\n\t\t [8] To Remove a Parent Process \n";
cout << "\n\t\t [9] To View How many Nodes are on the Network \n";
cout << "\n\t\t [Q] or [q] to Quit the Programme \n";
cin >> makeChoice;
system("cls"
switch(makeChoice)
{
case 1:
//cout << "Add Node to Network" << endl;
return(addNode());
break;
case 2:
return (notYet());
break;
case 3:
return (notYet());
break;
case 4:
return (notYet());
break;
case 5:
return (notYet());
break;
case 6:
return (notYet());
break;
case 7:
return (notYet());
break;
case 8:
return (notYet());
break;
case 9:
return (notYet());
break;
/* Comments for debugging
case 'Q':
case 'q':
//cout << "n\ Test \n";
return (copyRight());
break;
//default:
// cout << " Please Follow Menu Instructions \n";
// system("cls"
//return simulatorMenu();
*/
}
return simulatorMenu();