| Author |
return to main menu
|
Yani Abela
Greenhorn
Joined: Jan 30, 2012
Posts: 17
|
|
hi there
I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu. This is what I have done so far;
This is the main menu
Then the user chooses for example the number 1 (Clients) and the following menu is then shown:
now my problem is that I don't know what do I have to write in case 6 so that the main menu will be shown again. Can somebody please help?? Thanks
|
 |
Alex Armenteros
Ranch Hand
Joined: May 05, 2010
Posts: 46
|
|
My little advice.
Try encapsulation.
Put every menu inside a function like this
|
 |
Ted Smyth
Ranch Hand
Joined: May 28, 2008
Posts: 73
|
|
Yani Abela wrote:I am currently doing a DVD Rental System that when the user runs the program, he gets to choose from the menus. My problem is that when the user enters a menu and customizes for example a client, I don't know how to go back for the main menu.
Hi Yani! When case #6 is selected, you need to break out of that loop (typically by setting your while condition to false, see code snippet below). Without seeing your program I can't guarantee this will work, but likely this is the solution you are looking for. The "Clients" screen is a loop that was accessed from the Main Menu loop, so to return to the first loop, simply break out of the second loop.
|
Edward Smith
|
 |
Yani Abela
Greenhorn
Joined: Jan 30, 2012
Posts: 17
|
|
hey thanks for your replies !! they helped a lot and I solved it thanks again!!
|
 |
 |
|
|
subject: return to main menu
|
|
|