How do i put a loop round this so the user can only enter a number between

how do i put a loop round this so that the user can only enter a number between 1 and 3 if a number like 4 is enter it will just say something like retry
if (CA.trim().equals(ans1)){
Out = "incorrect";
else if(CA.trim().equals(ans2)){
Out = "incorrect";
else if(CA.trim().equals(ans3)){
Out = "correct";
else{
System.out.println("Enter 1 2 or 3 try doin test again");
System.out.println(Out);
byte b[] = Out.getBytes();
out1.write(b);

You already know the conditions so here's some pseudocode.
get input
while(input is not what I want (between one and three))
        Inform user of improper input and ask for it again
        get new input

Similar Messages

  • How do I put my wmv files to DVD so I can watch them?

    Ok, how do I put my wmv files on DVD so I can watch them?
    Would I have to convert it to an mpeg file ? If I do, what are good freeware software to use? Thanks

    You could try the free ffmpegX (http://ffmpegx.com/index.html), which is a highly flexible video converter/encoder (and I believe does WMV as well)... it does require the installation of some UNIX components, however I think this is done through the self-installer.

  • I recently sync one song to my friends iphone 4 and it erased all the music and only put that one song. I tried backing it up but it didnt help. How do I put all previous music back on the iphone?

    I recently sync one song to my friends iphone 4 and it erased all the music and only put that one song. I tried backing it up but it didnt help. How do I put all previous music back on the iphone?

    Re- sync the phone with the computer it was originally synced with.

  • HT2589 How do I put credit on my iTunes account so I can buy credits from a game?

    How do I put credit into my iTunes account so I can buy more coins while playing a game?

    You can add a payment method to your account. On your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on your iPad then try tapping on your id in Settings > iTunes & App Store and selecting 'View Apple ID' on the popup - that should also give you a payments link on your account's page.
    Changing payment info : http://support.apple.com/kb/HT1918
    Or are iTunes gift cards available in your country ?
    Redeeming a gift card : http://support.apple.com/kb/HT1574

  • I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this?

    I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this? I have 4 blocks of Single Choice fields in order for the summary page to give me each day in the final report. But, I need the user to be able to make a selection of any day and time and that apointment to no longer be available to future users when they log in. Plus, when the user clicks on the time, they are unable to change their mind and choose another time. Here's the link if you want to see what I'm talking about: 2015-2016 Workload Apportionment Review

    I'm afraid not.    It's not rocket science but you need to do some coding. 
    You'll need to find a script (php) and save it to your local site folder.  Then reference the script in your form's action attribute like so.
         <form action="path/form-to-email-script.php" >
    The input fields in your HTML form need to exactly match the script variables. 
    I'm  assuming you're hosted on a Linux server which uses PHP code.  Linux servers are also case sensitive, so upper case names are not the same as lower case names.  It's usually best to use all lower case names in your form and script to avoid confusion.
    Related Links:
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    Tectite
    http://www.tectite.com/formmailpage.php
    If this is all a bit beyond your skill set, look at:
    Wufoo.com (on-line form service)
    http://wufoo.com/
    Nancy O.

  • How do I put a "close file" icon in the toolbar? I've searched for an hour to find the answer with no luck?

    How do I put a "close file" icon in the toolbar? There's an "open file" icon by default, but I cannot -- in spite of searching for an hour--find a way to put a "close file" icon in there?

    Toolbar where? What program? What system?
    Mylenium

  • Hi guys, an empty folder is stuck in my trash & I get this message: "The Finder can't complete the operation because some data in the folder can't be read or written. (Error code -36). It won't shift no matter how I try to Secure Empty trash. Any ideas?

    Hi guys, an empty folder is stuck in my trash & I get this message: "The Finder can’t complete the operation because some data in the folder can’t be read or written. (Error code -36). It won't shift no matter how I try to Secure Empty trash. Any ideas?

    The Time Machines Backup is formated as Mac OS Extended (Case Sensitive, Journaled), my mac is formated as Mac OS Extended (Journaled).
    The names on the file are all Uppercase
    When I try to copy the Aperture file, it copies about 70% of the file (it's about 33GB in size), and halfway through I get this error.
    I'm able to copy 99.99% of all of the images if I open the Aperture Folder using the "show package contents" under the backups using finder (Time Machine Backups>Backups.backupdb>CQ Macbook Air>2012-04-30-070933>HD.....>Pictures>Aperture Library). The only file I can't copy is that picture, which I'm totally ok with deleting, but Finder won't delete it for me. If nothing else works, I could copy the individual masters and re-create the folders, however I'd hate to do this as I would have to go through 10,000+ pics

  • Yahoo is my home page and News, Sports, Business links now shows a few sentences after each main URL link. How do I put it back to show just the URL links?

    Yahoo is my home page and News, Sports, Business categories/links changed and now shows a few sentences after each main URL link/topic. How do I put it back to show just the URL links/topics without having to scroll down and down the page. All the extra sentences after the links causes too much scrolling to view the topics.

    Those steps did not solve my problem. Here is an example of what I see although it's not exact copy/paste. All I want to see are the links but I get all the verbiage after the links
    Firefox 17.0.1 version
    ''' '''Ask Stacy: How Can I Rebuild My Credit?''''''
    Here’s a question familiar to millions of Americans… Stacy, My wife and I recently filed for bankruptcy due to high medical bills we were unable to pay. We purposefully didn’t add our Wells Fargo credit ...
    Money Talks News
    '''Analysis: High stakes for Cuba in Chavez's cancer battle'''
    HAVANA (Reuters) - As Venezuelan President Hugo Chavez recovers in Havana from his fourth cancer operation, Cubans face renewed worries about their economic future if the country's top ally dies or has to step down from office. Cuba has staked its economic well-being on the success - and generosity…
    41 mins agoReuters
    [$$] Playing FICC or Treat With Bank Investors
    '''Playing FICC or Treat With Bank Investors'''
    The Wall Street Journal
    AdChoices
    '''Cybergeddon
    A digital crime thriller from Anthony E. Zuicker, the creator of CSI. Only on Yahoo!
    And here is what Internet Explore shows: All LINKS below
    '''Molten gold signals mining's return to Calif.'s Mother Lode'''
    '''Century-old fight for Budweiser name hits new snag'''
    '''NRA goes silent after Connecticut school shooting'''
    '''.Authorities: Kansas man who killed 2 cops dies'''

  • How to put selected videos in one place so I can only show those on my TV and not ALL of the videos I have ever taken.

    How to put SELECTED  videos in one place, so I can ONLY show the SELECTED videos on my TV and not ALL of the videos I have ever taken

    YYou have to describe your issue in more detail. Are you using iTunes? Trying to see it in Apple TV, etc, etc.

  • My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    My new nano keeps going into sleep mode every copy of minutes while music is playing.  I can't figure out how to stop this.  The user guide isn't too helpful.  Any ideas?

    This is usually a sign that your iPod's headphones are not plugged in all the way.  Make sure that you cannot see any of the silver still showing from the headphone's plug.  You should hear a sort of popping/clicking noise when inserting the headphones letting you know that they have been fully seated.
    B-rock

  • How  do you put songs on your ipod with the new itunes?

    How  do you put songs on your ipod with the new itunes?

    Do you mean remove them from the iPod or transfer them back to your computer? You can't transfer photo's back to the computer with iTunes. To retrieve photos from an iPod try:
    iPodPhotoCopy Windows only
    CopyPodPhoto Windows only
    iPod Photo Liberator Mac & Windows
    To remove individual photos from an iPod you delete or remove the photo from the folder that you linked to when you set the preference "synch photos from" and update the iPod. For example, if the iPod is getting the pictures from the folder "My Pictures," delete or remove them from My Pictures.

  • My daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    my daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    Meg\'s Dad wrote:
    …  I assume this format is what is needed to play on the class "Smart Board" also? …
    here in ol' Europe, school boards use chalk and are not smart …
    h264.mp4 is actually the most common 'standard' (4000 video 'standards' aaaaand counting)
    mp4 is indeed universal (Mac, Windows, Linux), and since YouTube, the h264 codec has a good installed base .....
    you can bump into probs only when it comes to sheer amount of data:
    for instance cheap 'digital frames' are sortof over-whelmed, if you try to playback 720/30p in high quality.
    I'm not familiar with 21st cent devices as SmartBoards ... again, it could happen, you have to reduce resolution/fps/bit-rate to avoid clutter&stutter in the video.
    I'm using such encoded files successfully on Playstation3, WD HD TV or flatscreenTVs with integrated usb-connection (via stick), etc
    imho, it should work welll .............. < fingers-crossed >

  • How do I adjust the page orientation in Pages?  I want to keep the pages above the section break as portrait, and the ones below I want to change into landscape.  Is this possible?  I can only get it to be one or the other but not both.

    I want to keep the pages above the section break as portrait, and the ones below I want to change into landscape.  Is this possible?  I can only get it to be one or the other but not both.

    The work around is to do two documents, one in portrait format and one in landscape format. When finished export to Pdf. open in Preview by select both files and use Cmd + O or doubleclick. You can now in Previews thumbnail column the pages from one document into the other and then save.
    If you have created only one with i.e. all pages in portrait format but with the content for the landscape pages rotated on the pages, you can rotate the pages in Preview. Two ways to get the same result.

  • How do I fix this? "the iphone can not be synced an unknown error occered. (1140)"

    after updating my iphone 4 to ios 5 i can not sync my iphone, im getting this message: "the iphone can not be synced an unknown error occered. (1140)"
    also when ever i try to open any applications that dont already come on the iphone they dont open, such as facebook. it just glitches the screen. I think that syncing will fix it but i cant get it to syc!

    I also have the same error when trying to sync my iphone 5 to iTunes wirelessly and wired.  The iPhone "Name Goes Here" cannot be synced.  An Unknown error occured (1140).  Any help would be appreciated.

  • ADF table: How to find out which rows were modified by the user

    Hi,
    I am using ADF table to display data that can be modified by the user (ReadOnly = false in the input text). I need to find out which rows were modified by the user, and only update (persist) those rows in the database.
    Is there an easy way to find out which rows were modified by the user.
    I am NOT particularly concerned with which columns were modified as I would update the entire row (if any data in that row is modified).
    I am using Oracle JDeveloper version 11.1.1.3.
    Thanks,
    Ash K

    Thanks Timo.
    I am using ADF Data Control (which are created from Web Service proxy) to display/update the data.
    In the backing bean, the operation that is invoked at the time persisting data is as follows:
    public void commitOperation {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("operationA");
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("someIterator");
    for(int i=0; i<dciter.getViewObject().getEstimatedRowCount(); i++)
    Row row=dciter.getRowAtRangeIndex(i);
    SomeObject someObject= new SomeObject ();
    someObject.setAttr1(row.getAttribute("Attrbute1").toString());
    someObject.setAttr2(row.getAttribute("Attribute2").toString());
    objectList.add(someObject);
    operationBinding.getParamsMap().put("param1", objectList);
    ResultObject result = (ResultObject) operationBinding.execute();
    Inside the for loop (or any other place in the backing bean), I would like to figure out if the row was modified by the user. Please let me know if how to get that. If ADF provides this automatically, that would be GREAT.
    Thanks,
    Ash K

Maybe you are looking for