Ok I'm doing my final project for my Data Structures class and have a quick question. This hasn't come up in any of my programming classes yet (which now that I think about it, is kind of odd but oh well).
What I'm having to do is write an interactive program allowing the user to access 3 different data structures. That part I have no problems with (going to use Stacks, Queues & Binary Tree). What I'm wanting is to have the main menu display:
1) Use Stacks
2) Use Queues
3) Use Binary Tree
4) Exit Program
then it goes into the submenu for that option.
What I need is to reset the program so when they finish with that data structure it brings them back to the main menu.
Here is what I'm thinking should work, am I right or do I need to go about it differently?
do
{
" Display main menu here"
if (option 1 is picked)
{
do
{
"Display menu for selection"
run program
}
while (user does not select to exit)
}
if (option 2 is picked)
{
do
{
"same as option 1"
}
while (user doesnt select to exit)
}
}
while (user doesn't select to quit entire program)
Now before everyone starts to nit pick at my code, it's just a shell to give you an idea of what I want to do.
Thanks