What do i need to do to get this to work properly

         for(int i=0; i<6; i++){
         do {
             JOptionPane.showInputDialog(null, "Enter guess" + " " + (i+1));
             if (guess<1 || guess[i]>6 ){
               JOptionPane.showMessageDialog (null, "That's not between 1 and 6, try again", "Invalid", JOptionPane.WARNING_MESSAGE);
          }while (guess[i]<1 || guess[i]>6);
Basically, this compiles, but when i run this any input i put in gives the warning message. I need the warning message to happen only when the input is less than 1 or greater than 6. Anyway around this? I'm using an array of integers for the guesses as you can see.

Having some code somewhere that changes the value of
those array elements to be something other than zero
would be a start.
And getting the value from the JOptionPane would be a
good bet. The showInputDialog returns a value so
you're in luck.Do you mean I should change the value of i to something other than 0? I'm not too sure what you mean, I'm quite new to Java.

Similar Messages

  • I downloaded the accept all request for facebook but when I go to the game requests page there is no accept all button. What do I need to do to get this to work?

    I have closed out of facebook and reentered but there is still no accept all button on game request page. I checked on add-on and it says it is enabled but is not there. I need to know what to do to get this to appear/work on facebook.

    If you have firewall/anti-virus software running turn them off.  With your iPad connected to your computer via USB and with iTunes open, once your iPad is recognized on the left side of the iTunes screen, look to the right and you should see a box that says Check For Software Update.  Click on that and iTunes should start the process of updating your software.  Please note that the process of updating to iOS 5 or higher is not a short process.  It takes time, so make sure you have enough time and you can stay there with your iPad and your computer to guide the process.

  • Garage band 10 will not let me purchase extra sounds, what do I need to do to get this to work ?

    The in app purchase in Garage Band 10 will not work for me. What do I need to do to purchase extra sounds ?
    There is no accept button showing in my purchased items it shows Garageband installed.
    Thanks

    Hi Brushfo149,
    Thanks for visiting Apple Support Communities.
    If you're not able to purchase content in GarageBand, try the steps in this article:
    GarageBand for Mac (v10.0): Unable to complete in-app purchase
    http://support.apple.com/kb/TS5275
    When trying to make an in-app purchase from GarageBand for Mac (v10.0) you might be unable to complete the purchase. This can happen if you haven't accepted the app from the Mac App Store.
    To resolve the issue:
    Quit GarageBand.
    Open the Mac App Store.
    Sign in using the Apple ID you used to set up the computer.
    Click the Purchases tab.
    Click the Accept button next to GarageBand.
    Open GarageBand.
    You should now be able to make in-app purchases.
    All the best,
    Jeremy

  • I can't left click to select or right click for menus. This works in IE, what do I need to do to get this to work in firefox?

    I don't understand why this doesn't work. My OS is vista. The right click for menus stopped working several months ago, so I have been using IE when I need that. The left click to select stopped working 2 days ago. So now firefox is unusable unless I can figure out why it is doing this.

    -> click Firefox button and click Exit
    -> Start Firefox in Safe Mode (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    https://support.mozilla.com/kb/Safe+Mode
    -> Firefox Safe Mode window will open. DON'T SELECT ANY OPTIONS, just click Continue in Safe Mode
    Check and tell if its working while you are in Safe Mode.

  • My photoshop CS2 no longer works after I installed OS Yosimite. What do I need to download to get this to work?

    Is there a download to help this?

    Eileen - I also had issues with Photoshop and Dreamweaver after I installed Yosemite.  I went to the link below and download a the new Java.  It solved the problem for me.  BUT, I have CS5........so I don't if it'll work for you.
    http://support.apple.com/kb/DL1572

  • What do I need to do to get this to work?

    import java.net.*;
    import java.io.*;
    public class Client{
         public static void main(String [] args){
              try{
                   Socket server = new Socket("127.0.0.1",27700);
                   System.out.println("Connection Opened");
                   InputThread it = new InputThread();
                   it.start();
                   server.close();
              }catch(UnknownHostException e){
                   System.out.println("Host not found.");
                   System.exit(0);
              }catch(IOException e){
                   System.out.println("Error connecting to host.");
                   System.exit(0);
              }catch(Exception e){
                   System.out.println(e);
                   System.exit(0);
    class InputThread extends Thread{
         public void run(){
              try{
                   BufferedReader rd = new BufferedReader(new InputStreamReader(server.getInputStream());
                   String text;
                   for(;(text = rd.readLine()) != null;){
                        process(text);
                   rd.close();
              }catch(Exception e){
                   System.out.println(e);
                   System.exit(0);
    Errors:
    BufferedReader rd = new BufferedReader that has a ) expected
    BufferedRead rd = new BufferedReader also has a cannot resolve symbol on variable server
    process(text) cant resolve symbol
    Why doesn't this work, I know there's something wrong, but I can't figure out how I should do this?

    Well I found the BufferedReader ) closing thing problem, woops...lol...but I still can't figure out the rest...

  • HT5167 When I try to install the update"MAC OS X Update Combined, I get a message that says it cannot be saved & connection reset by peer.  What do I need to do to get this update installed.  I just purchased my first iMAC and don't know anything about it

    When I try to install the update"MAC OS X Update Combined, I get a message that says it cannot be saved & connection reset by peer.  What do I need to do to get this update installed.  I just purchased my first iMAC and don't know anything about it.

    Try here:
    http://support.apple.com/kb/DL1524

  • I set up a hotmail account and I got a message stating "the connection to the server failed" what do I need to do to get my email working.

    I set up a hotmail account and I got a message stating "the connection to the server failed" what do I need to do to get my email working

    Do you have a good wifi connection?
    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • The location of my hometown (Hysham, Montana) is off by over 50 miles ever since Apple Maps came out.  I have been reporting off and on ever since but it has never corrected.  What do I need to do to get this fixed?!

    The location of Hysham in Apple Maps is off by over 50 miles and has been ever since the advent of the app.  I have gone through the motions many times to place the pin the correct location.  Unfortunately, no one at Apple seems to care if Hysham, Montana is plotted in the correct location or not.  The location displayed in Apple Maps is quite literally in the middle of nowhere.  If someone were to rely on Apple Maps to get to Hysham may very well end up marooned in the midst of muddy two track road in the summer or stuck in a snowdrift in the winter with little or no hope of expedient assistance.  Other than the reporting feature in Maps, there appears to be no other means to report mistakes and there appears to be no expedient means at Apple to filter through reports and fix the errors.  In sum, What do I have to do to get the location of Hysham fixed in Apple Maps?  Much thanks!

    You have done all that you can. Apple maps depends on 3rd party map data solutions. As problems are reported, they are reported to the data providers. How and when they decide to make changes is up to them.
    You can also let Apple know you are disappointed in this via feedback at www.apple.com/feedback and click on the appropriate link.

  • Iphoto is not updating with the library upgrader in Yosemite. what do i need to do to get iPhoto to work?

    I downloaded iPhoto library upgrader. It is not working.
    What do i need to do?

    murf_75 wrote:
    I downloaded iPhoto library upgrader. It is not working.
    What do i need to do?
    Provide details on how it's not working.  Please detail ALL you have done so far in the way of troubleshooting?  Need this info to avoid the been there done that scenarios.

  • HT1688 I recently upgrade my Iphone but the old one is still active. I installed the friendjectory app on my new phone but it will not open but for a few seconds ab=nd then closes. What is wrong and what do I need to do to make this app work on my new pho

    I recently upgraded my Iphone. Iinstalled the friendjectory app on the new phone but it will not open but for  few seconds and then closed. What is wrong and what do I need to do? My old phone is still active and working. Do I need to do something about that?

    Hi stanczak53,
    Welcome to Apple Support Communities.
    See this link for some tips on troubleshooting apps on your iPhone:
    Using apps on your iPhone
    http://www.apple.com/support/iphone/assistant/application/
    Best,
    Jeremy

  • I want to download trail of Photoshop to see if it will do what I am needing... It made me download Creative Cloud and now it won't even open...... What do I need to do to get this free trial of Photoshop?

    When I downloaded Creative Cloud it made me set up an account, download, verify my email. Now when I go and double click or right click and run, or right click and run as an administrator, Creative Cloud does nothing.................. I just want to download a trial of Photoshop to see if it will let me edit my images the way I need them done... If it works I plan on purchasing it because I will need to edit pictures repeatedly. It is quite frustrating when I try and download Photoshop and it makes me download this other thing to make it more "seemless" but then it doesn't even work. Now when I go to try and download Photoshop it just redirects to the Creative Cloud website and pops up saying it has to open something outside of Google Chrome. If I hit cancel, it does nothing (obviously), if it hit launch, it still does nothing...................... What am I doing wrong here???

    Please provide your operating system details along with the version of PS you are trying to download.
    If possible, paste a screenshot of the error that you get on Creative Cloud desktop app. FAQ: How do I capture and post a screen shot or video?
    ~ Arpit

  • A member of my family previously downloaded the free trial and now that i need it, it won't let me download it. what can i do for free to get this to work?

    How can i get a free trial? it's previously been downloaded, not for my use but now it wont let me have it and i need it for college. Help?

    gbraye,
    Is a single month student subscription an option, or using another computer?
    The failure to download is owing to the facts that you can only have a trial once, and the Adobe system is based on identifying through the computer.

  • I want to forget a network, but the "forget this network" option is not available.  What do I need to do to get this option to show?

    The "forget this network" option is not available on my iPod touch, can someone tell me what I need to do to have that option show.
    Thanks :-)

    You must be connected to the network you wish to forget. If you are, head to Settings -> Wi-fi and click the > next to the network you are currently connected to.  At the top of the next screen is the button to "Forget this Network."
    B-rock

  • What do you need to do to get C & Q working?

    I heard something about getting something for Windows as well as just enabling it in BIOS, what would this be may I ask?  

    http://www.amd.com/us-en/assets/content_type/DownloadableAssets/Cool_N_Quiet_Installation_Guide3.pdf

Maybe you are looking for

  • How can i update to ios 6.1.3 on my model 1219

    i have tried to update my ipad model 1219 to ios 6.1.3 and also 7. with the current ios it will not download many of the apps and other things I'd like to have on it. Is there any other way to download this ios.? I have tried to go thru itunes etc an

  • Best practice for WFMailer in a cloned environment

    Hi, What are the best practices to purge/clear out old notifications when we refresh dev instances from prod? Also, what steps do we need to restrict future messages going to all the users. I have been clearing out the email from the fnd_user table,

  • Components

    hi! I´m Paulo and i have 2 Dual-Core Intel Xeon 3GHz, and 1 Macbook Pro 2.33GHz Intel Core 2 Duo, at home i have the Last imac with Power PC 5 2.1GHz, i install in all machines the Final Cut Pro Studio, but i have a problem with the components, the q

  • Query on OT Calculation

    Our customer wishes the overtime hours to be computed in the following manner: 1. Accumulate all the approved extra hours worked by the employee during the calendar month. 2. Accumulate all the LOP hours for the employee for the calendar month. 3. Co

  • Calculated field in List not reaching workflow

    I have a list that looks up a value in another list.  I also have a calculated field in the list that finds the ID number from the lookup field by finding the ;. When my item created SPD workflow runs, the calculated field has invalid data (#Value!).