![]() |
|
#1
|
|||
|
|||
Homework help with loopingHi my assignment is simple I was to display a menu and then build functions that would do various things based on the user selection. my problem is I'm trying to have a do loop that will display the menu function display_menu until the q (quit opintion) is selected. What I want my loop to do is to is to keep displaying the menu function unitl q is selected then quite and exit the program. here are the area of codes I believe need some kind of fixing.
CPP / C++ / C Code:
if on the next user entry is q is entered it will exit the program. Thank you for your time and help. to compile the program I'm using Microsoft visual studio 2005 on a windows XP o/s |
|||
|
#2
|
||||
|
||||
Re: Homework help with loopingFirst off, do you have to use Microsoft Visual Studio 2005? If not then STOP, instead use either Code::Blocks or Bloodshed Dev C++ or any other free compiler.
Second, do you mind posting your entire code? I don't know how you're invoking the loop or getting the new choice. |
|
#3
|
|||
|
|||
Re: Homework help with loopinghere is the entire code:
CPP / C++ / C Code:
|
|
#4
|
|||
|
|||
Re: Homework help with loopingUse int main instead of void because this is not a standard C++ code.
__________________
Linux is the best OS in the world. |
|
#5
|
|||
|
|||
Re: Homework help with loopingQuote:
Without looking at the functions other than main(), here's a suggestion: In your loop, you should call the display_menu() once. Save its value to use as loop control. Also look at the logic to decide when to continue: If the choice is not equal to 'Q' and the choice is not equal to 'q' you will continue. So your version of main() could look like: CPP / C++ / C Code:
Regards, Dave |
|
#6
|
|||
|
|||
Re: Homework help with loopingthanks this seems to have fixed the problem!!!! that one little change from || to && and the few other changes fixed it. Thanks again for your help
|
Recent GIDBlog
Going to Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Input stream question | earachefl | CPP / C++ Forum | 17 | 26-Sep-2007 20:21 |
| New to programming (Homework Help) | fishguts | Miscellaneous Programming Forum | 1 | 12-Sep-2007 10:50 |
| Code for Homework | bobbiegirl | Java Forum | 2 | 26-Feb-2007 20:34 |
| Need help with Looping | Harryt123 | C Programming Language | 4 | 21-May-2006 14:45 |
| Need Help W/ Homework Due Tomorrow | ilovethebeach | C Programming Language | 7 | 10-Sep-2005 14:09 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The