Need some help...don't know what I am doing wrong
here is the code...if I type anything other than a number it continually loops without asking for input again...what do I need to do differently.
* SongMenu.java
* Created on November 14, 2005, 8:55 PM
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
import java.util.*;
* @author jessekangas-hanes
public class SongMenu {
/** Creates a new instance of SongMenu */
public SongMenu() {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
boolean menu = true;
Scanner kbd = new Scanner(System.in);
int menuselection;
while(menu){
try{
System.out.println("--------------------------------------------------------------------------");
System.out.println("| Menu |");
System.out.println("| 1 = create a new song list |");
System.out.println("| 2 = read songs into the current song list from a file |");
System.out.println("| 3 = Input a song from the keyboard and addit to the current song list |");
System.out.println("| 4 = Select on or more songs from the current song list |");
System.out.println("| 5 = Display current song list on the console |");
System.out.println("| 6 = Print selected song(s) to the console |");
System.out.println("| 7 = Write the current song list to a file |");
System.out.println("| 8 = Write the selected songs to a file |");
System.out.println("| 9 = listen to selected songs (or all the current songs) |");
System.out.println("| 0 = Quit the Program |");
System.out.println("--------------------------------------------------------------------------");
menuselection = kbd.nextInt();
switch (menuselection){
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 0:
menu = false;
break;
default:
break;
catch (InputMismatchException e){
System.out.println("Invalid selection.\nPlease Try Again");
}
Try this:
menuselection = kbd.nextInt();
kbd.nextLine(); // clears the rest of the line for inputs like: 1 a
catch (InputMismatchException e){
System.out.println("Invalid selection.\nPlease Try Again");
kbd.nextLine(); // clears the line for bad inputs like: w
...
Similar Messages
-
Iphoto Question
When I playing a "slideshow" album, a few photos show up as a blank screen. Also, when I select a photo in an album to make it full screen - some photos won't "hold" - they go full screen for about a second, then the screen goes blank. Any ideas about what I am doing wrong? Thank you.There are several possible causes for the Black Screen issue
1. Permissions in the Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to check and repair permissions.
2. Minor Database corruption: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild.
3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/ Library/ Caches...
5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
If none of these help: As a Test:
Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
Import a few pics into this new, blank library. Is the Problem repeated there? -
Cannot get Shuffle to be recognized by pc. Have went through asst. 5 times, don't know what to do now!!
If this is a new shuffle, make sure the plug on the USB cable is completely inserted into the shuffle's headphones jack, as shown in this document
http://support.apple.com/kb/ts3572
If it is properly connected, does the shuffle's light come ON at all, when you connect it to USB? If it does, what does it do immediately after connection? -
Old and new android are paired somehow the old phone answering calls and TeX but new phone is the active one both phones keep crashing what am I doing wrong.Done multiple factory resets on old phone trying to fix this spent countless hours and days on this
Sorry but we are unable to provide specific help with the Android operating system. Talking to your mobile provider in person may be helpful.
-
Apple ID won't let me reset my security questions. I don't know what I'm doing wrong?
I have tried multiple times but it won't let me. I have to change them because I forgot what the original ones are. Help!?
Congratulations on being the next victim of Apple's current SNAFU!
If you don't have a rescue email address set, then you're SoL.
If you do, then reset your info and check in there.
If not, you'll have to contact iTS, and wait for God knows how long for Apple to complete its pending investigation in this SNAFU.
iTunes Store Support
http://www.apple.com/emea/support/itunes/contact.html -
Hi my 4s is only 5 days old and I have the OTTER Box from day 1 and it has turned off by itself and will has not turned back on some help let me know what to do I'm dieing over here
If it is only 5 days old, take it back to where you bought it
and get it replaced. -
Everything I own (iPad, iPhone, mac) is set up on wi-fi. when i bring my work computer home (dell laptop), I cannot get it to keep the connection in a different room. All my other devices work.... does anybody know what i am doing wrong? please help!
Windows drivers for Intel wireless cards are known problematic.. If you have plenty of signal and it still cannot keep or hold the connection the issue can simply be the type of wireless.
Another problem is using names that windows does not easily handle.
eg If you set the TC using apple names, like
Fred Blog's Airport Time Capsule wireless24ad12
Then to windows this is too long.. it has spaces and it has illegal character.
Change all names on the TC to suit windows. Short, no spaces and pure alphanumeric.
Also security must be suitable.. I have no idea how old or what OS your dell is, but if you still have issues.. pull off the security on the TC for a test.. if the computer suddenly works, it is not compatible with WPA2 AES. Make sure you also use a password that is mix upper and lower case plus numbers.. avoid special characters and make it 10-20 characters long say.. it is not required to be more than that unless you are paranoid. -
Ugh. How do I get iCloud on my iPhone? I have been using my iPhone for about a year and I have an iCloud account but it is useless since nothing syncs to nothing else. Obviously I don't know what I am doing.
Welcome to the Apple community.
Have you logged into your iCloud yet on your phone, in settings > iCloud. -
we have rented and purchased movies to use but cannot get them to play - just says loading error try again later. Does anybody know what we are doing wrong? We have managed to get it to work a couple of times but that is all
Welcome to the Apple Community Tarskforce.
Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.
The following article(s) may help you.
Troubleshooting Wi-Fi networks and connections
Recommended Wi-Fi settings
Sources of Interference
Wifi Diagnostic Software (for Mac users) -
I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?
Welcome to the 'wonderful' world of HTML5 e-learning.
In my view, from the issues I am seeing everywhere, HTML5 output from rapid e-learning tools such as Captivate is not ready for the kind of mobile device e-learning you want to develop.
Sorry to be pessimistic, but you may need to consider going back to the drawing board and coding it from the ground up. -
I'm in cycle mode, and 'merge' is clicked in preferences. However, when I record, my previous track data keeps getting overwritten. Does anyone know what I'm doing wrong. Interestingly, I can still see the data in the region.
jamestait wrote:
when I record, my previous track data keeps getting overwritten.
since you didn't specify, are you recording in a single take?
http://www.bulletsandbones.com/GB/GBFAQ.html#multipassrecording
(Let the page FULLY load. The link to your answer is at the top of your screen) -
When i place my photo, the adjustments tab does not pop up, and even when i click image at the top, I cannot select any adjustments-brightness/contrast,hue-saturation, color blance, etc..Anyone know what I am doing wrong?
Good day!
What is "place" supposed to mean – open, place as Smart Object, …?
What are the image’s Color Mode and bit depth?
Could you please post a screenshot with the pertinent Panels visible?
Does Window > Adjustments not raise the Adjustments Panel?
Regards,
Pfaffenbichler -
I can not change the style of a pencil,brush, or pen. The options are greyed out. Anyone know what I am doing wrong???
Hi,
Stroke styles are disabled in HTML5 Canvas document type as the target platform doesn't support those. Please check your document tab if it reads '<yourfilename> (Canvas)' then you have created a HTML5 Canvas document.
If you have created HTML5 document by mistake, then you can copy paste your layers into AS3 document then you can change the stroke style to your desired option.
Thanks!
Mohan -
I am new with iPhone. My battery needs charging all the time. What am I doing wrong?
Have a look here > iPhone Battery Optimise
http://www.apple.com/batteries/iphone.html -
Hi Experts,
Since from 15 days I am working on one Dashboard with BEX query, now I have completed that I am able to run that till yesterday. But today my SAP USER ID expired(every 15 days it expires). I have updated same password in all places(CMC OLAP, UNV,IDT) and tried to open the same XLF (which was running fine till yesterday ) after opening that if I tried to edit query or tried to add query or clicked on preview....all ending with locking of my SAP USER ID(SBOP) ..............Don't know what the damn thing happening please seng if you know any solution.
Experts need help to solve this issue urgently .........:)
Thanks in AdvanceHi Mahantesh,
We have faced same scenario,this is happening due to SAP User ID password change.
Stop all the BO work and change the password of SAP everywhere used.Any single point will lock it again.
Try this.This has worked for us.
Regards,
Javed
Maybe you are looking for
-
Inserting timesten imdb cache is taking more time than insert in db11g
Hi, I'm very new in Timesten imdb cache. I just recently installed imdb cache in an app server then installed oracle 11g in a db server and get to integrate them. So i wanted to test the performance of imdb cache .. i create an insert scripts that wi
-
Help reopen case for reset of phone
The account limit was reached on my iPhone and it needs to be reset.
-
I just connected an external display to my MacBook Pro & have a couple of very remedial questions. I have the displays set up in the "extended desktop" mode. But when I open an image in ACR, I cannot drag the ACR window to my external display. Can yo
-
VOIP home lab with cisco 2620 and VIC-2FXO port
Hi all, I m considering building a home lab for studying CCVP, the lab would be based on the follow components : - CUCM 8.X (already installed) - A couple of soft phones running in VMWARE with IP Blue and CIPC (they are already in place and registere
-
Queries regarding Boleto and Duplicata
Hi All, I am a new member of this site.We have got a requirement for developing sap scripts for Brazil. Did anyone happen to work on Boleto and duplicata? The standard forms available are J_1b_boleto_itau and j_1b_duplicata. Can anyone please explai