alan8311 Posted March 3, 2005 Share Posted March 3, 2005 here is the part of my program... My problem is when i pressed the key other than s,d,c,e.. the program will not display anything....suppose the program should display out the default --> "System.out.println("Invalid Option! Try again..");"can anyone help me to debug this?????? PLEASE do { /**Call the clear screen method*/ clrScreen(); /**Display main menu and title*/ mainMenu(); /**Show the content of all categorys*/ //Parameter: 1 is refer to normal display //Parameter: 2 is refer to Daily Sales Collection showContent(cakeList, pastriesList, cookieList, 1); /**Get a user selection*/ option = selection(); /**Define the option*/ switch(option) { case 'S': case 's': { // if capital S or small s is pressed then the Sales function is called salesFunction(cakeList, pastriesList, cookieList); break; } case 'D': case 'd': { //is capital D or small d is pressed then the Daily Order function will be called orderFunction(cakeList, pastriesList, cookieList); break; } case 'C': case 'c': { //Collection Methods clrScreen(); subMenu(); showContent(cakeList, pastriesList, cookieList, 2); System.in.read(); System.in.read(); break; } case 'E': case 'e': { //Exit the program exit(); break; } default: { //If other then the above option, shown invalid option System.out.println("Invalid Option! Try again.."); break; } } } while (option != 'E' && option != 'e'); Link to comment Share on other sites More sharing options...
zprog Posted March 4, 2005 Share Posted March 4, 2005 You're gonna have to post the entire source. Code should work, but post the entire source to see if you forgot to define stuff somewhere. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now