Sending a program back to the beginning..

I dont think the topic explains it right, but I need to be able to go back to the beginning of the block again if it loops. I'll just post the code as its probably easier to see what I want to do that way... :)
public class ABCInput
     public static void main(String []args) throws Exception
          char letterInput;
          System.out.println("Type A, B, C, or Q.");
          letterInput = (char)System.in.read();
          System.in.read();
          System.in.read();
          while (letterInput != 'A' || letterInput != 'B' || letterInput != 'C' || letterInput != 'Q')
               System.out.println("Incorrect, try again.");
               letterInput = (char)System.in.read();
               System.in.read();
               System.in.read();
          while (letterInput == 'A' || letterInput == 'B' || letterInput == 'C')
               System.out.println("Good Job.");
               System.out.println("Add another character");
               letterInput = (char)System.in.read();
               System.in.read();
               System.in.read();               
          if (letterInput == 'Q')
               System.out.println("Exiting Application!");
               System.exit(0);     
}

Instead of putting little loops around each case, put a large one around everythingchar letterInput;
System.out.println("Type A, B, C, or Q.");          
letterInput = (char)System.in.read();
while (letterInput!='Q') {
   If (letterInput=='A' || letterInput == 'B' || letterInput == 'C') {
       //blah
  } else {
    System.out.println("Incorrect, try again.");
  letterInput = (char)System.in.read();
System.exit(0);

Similar Messages

  • The new forced upon me upgrade for iPhoto '11 never opens. After I do all that is recommended, it sends me back to the beginning. How can I get it to work?

    I am using a mac mini version 10.9.5 which I have just updated. Now when I try to open i photo, all I get is a message telling me to "prepare" my library. I have installed and run the iPhoto library upgrader, but it only sends me back to the beginning telling me to install the upgrader (which has already been installed.)
    How can I actually get the upgrader to prepare my libraries and actually see photos?

    What version of iPhoto are you currently running and what version did you have previous to the upgrade to 9.5.1?
    Apply the two fixes below in order as needed:
    Fix #1
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - run Option #4 to rebuild the database.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button and select the library you want to add in the selection window..
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.

  • Security Questions (3) for AppStore iPhone - the program won't allow me to save the questions, keeps kicking me back to the beginning and erasing the ones I've entered.

    Security Questions (3) for AppStore iPhone - Every time I try to enter the 3 security questions, it keeps kicking me out of the program and won't allow me to save the questions, keeps kicking me back to the beginning and erasing the ones I've entered.  I can't get passed this point to download anymore apps from the app store.
    Help!!!

    You can try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                                
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             

  • My printer reads my SD card but wont allow me to print it keeps going back to the begining.......

    my printer reads my SD card but half ways through it keeps sending me back to the begining its a KODACK sd card, my HP laptop is no problem when it reads the card, buy why cany i print directly from my SD card.......very frustrating

    If you head to Settings -> General -> Date & Time is it set to Automatic?  Head to Settings -> General -> International -> Calendars and make it is set to Gregorian.
    It might not hurt to reset the iPod as well.  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    B-rock

  • Need to send a mail back to the user in Sender Mail adapter Scenario

    Hi all,
    I have a scenario where the user fills the Price form  or the Article form (which is a Adobe Form).When the user clicks on the "submit" button,the form is converted into xml , gets attached to the mail and sent to PI.
    Now the user sometimes attaches the pdf directly instead of submitting the form. This results in the mail being sent
    with pdf  as attachment.
    Now my requirement  is to send a mail back to the user asking them to send an xml  instead of a pdf.
    How can this be done ?
    Kindly let me know friends.
    Quick Response is appreciated.

    hi Sanjay,
    Have a look on Michal's blog, it's for JMS, but it works for others: [PI/XI: Quick tip: Preserving attributes of XI messages via MultipartHeaderBean|PI/XI: Quick tip: Preserving attributes of XI messages via MultipartHeaderBean]
    Mickael

  • Ok. So my iTunes started acting up a few months ago. ALL of the songs I purchased from the iTunes store stop in the middle of the song and then go back to the begining (I keep it on repeat one song by the way). Please help!!! (Windows 7)

    Ok. So my iTunes started acting up a few months ago. ALL of the songs I purchased from the iTunes store stop in the middle of the song and then go back to the begining (I keep it on repeat one song by the way). Please help!!! (Windows 7) I would really like to hear my songs all the way through, but I can't . I tried the "Convert Protected ACC files to Purchased ACC files fix" but it DIDN'T work. I don't know what to do. It does it when I transfer the music onto my Classic too.

    What do you mean "doesn't recognize"?

  • Is there a way to view earlier messages in a thread without going through each day? Also, can you make a photo album from the same text thread without going back to the beginning?

    Is there a way to view earlier messages in a thread without going through each day? Also, can you make a photo album from the same text thread without going back to the beginning?

    Turn Settings > General > Accessibility > Zoom to ON.

  • How can I get Firefox to take me back to the last Bookmark folder I was in like Internet Explorer instead of going back to the beginning each time??

    When i find a website using bookmarks in Firefox and then I want to look at another site in that same folder, especially in a subfolder, Firefox takes me back to the beginning of the bookmarks menu. With Internet Explorer, it takes me back to the same folder or subfolder I was in. For example, if I was wanting to search newspapers, especially if they are in subfolders, I want to stay in that same place. Firefox loses that place, unlike Internet Explorer, and takes me back to the beginning each time. Sometimes I have several layers of subfolders and it takes time to find that place again each time.

    A possibility is to open the Bookmarks Sidebar.
    Click the list icon next to the star on the Navigation Toolbar and click "View Bookmarks Sidebar" (Ctrl+B).

  • When i play back an mp3 dj mix i,ve burn,t to cd in my car when i turn the engine of and then restart the car the cd starts back from the beginning how do i solve this problem so that when i turn the engine on end off the cd plays from the same place

    when i play back an mp3 dj mix i,ve burn,t to cd in my car when i turn the engine of and then restart the car the cd starts back from the beginning how do i solve this problem so that when i turn the engine on end off the cd plays from the same place it did before i turned the engine off

    It could be that the CD player will only playback "Redbook" CD's from the previous position.
    And starts mp3 type CD's from the beginnig.
    However.. it's not Logic related.
    pancenter-

  • Is this beta? The image for Yosemite is a very big rock, appropriate as this OS sends your mac back to the stone-age. iTunes crashes on open, iPhoto won't download, movies won't play, Safari won't show graphics, wifi down to speed of crippled snail.

    Is this beta. The image for Yosemite is a very big rock, appropriate as this OS sends your mac back to the stone-age. iTunes crashes on open, iPhoto won't update, Safari shows text without graphics, can't get Java 8 'cause Safari "can't find server". Wifi slower than a crippled snail. Does anyone know how to uninstall this rubbish?

    travellingbirder wrote:
    Is this beta ?
    You tell us Finding the OS X version and build information on your Mac.

  • Back to the beginning after some time

    I am holding a director in the software for a multimedia
    kiosk but encounter me with the problem that I am not able to solve
    what I want is that when a user leaves the navigation through the
    software by the end of a time without being used (for ai 1 minute)
    go back to the beginning, that is the frame 1 .. So while others
    used to go to the kiosk application is the beginning ...

    Hello,
    You can set a timeout to handle what happens when no one
    interacts with the computer for a certain period of time. In your
    startMovie script, add
    on startMovie
    the timeOutLength = 60*60 --Add a length here. It is in 60ths
    of a second, so 1 minute is 60*60
    end
    Then, in a movie script, add
    on timeOut
    --Put your script here
    go to frame 1
    end
    That should be it. I realize you don't speak English well,
    but this should put you in the right direction if you don't
    understand it all.

  • Can anyone explain why on my iPhone 4S, whenever I play music, it won't hold my place in the song? I pause it, and then when I go back later, it's all the way back at the beginning? A google search was not very helpful, any tips would be great!

    Can anyone explain why on my iPhone 4S, whenever I play music, it won't hold my place in the song? I pause it, and then when I go back later, it's all the way back at the beginning? A google search was not very helpful, any tips would be great!

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • Slideshows Music stops and goes back to the beginning

    Just today i created a couple of slideshows with my new MBP and the problem is that in both slides shows, music stops in the same moment and goes back to the beginning, although slideshow continues going on.
    Each slide show has a different song, but this happen at the same moment.
    I have a MB and doing exactly the same slideshows with the same photos and music, I don't have this problem
    thanks

    I just read that converting the music to AAC files, will fix this.
    But why is happening this???.
    I mean, in my other Macbook i don't have this problem, same slideshow with the same music works perfect.
    thanks

  • HT3458 How do you go back to the beginning of playlist

    How do you go back to the beginning of playlist on ipod shuffle

    The device only displays the last portion of a large text message. I'm not aware of any other method to access the beginning of the conversation except to scroll and keep loading the older part of the message. I would imagine to help with RAM management, the device does not load entire conversations.
    You can provide feedback to Apple HERE, if you would like to see a change in the way the device displays messages.

  • IMovie keeps springing back to the beginning

    Help! I'm a new user with iMovie. Had some success moving images from iPhoto to timeline, but now the file keeps springing back to the beginning and I can't drag and drop images to where I need them to go, nor can I preview in the large screen what I've got. Brand new software: iLife '06.
    Any help is most appreciated.

    Hi Robert
    Not sure what you mean "file keeps spring back to the beginning". Beginning of what?
    I have a G4, 10.3.9 with iLife 06 and whenever I have these quirky problems I run the disk permissions from the utility folder and Disc Warrior. If this doesn't help then one of the more knowlegeable who frequent this forum might be able to help you.
    Tom L

Maybe you are looking for

  • When I plug my my Ipod classic into my PC it crashes

    Because of the bossy media player conflicts that go along with Itunes, I decided to use a different Media Management software component in my Windows Media Center Edition PC( Sony Vaio ). I have almost 85GB of music on my Ipod Classic and it was quit

  • No longer able to receive photos in gmail or firefox, through chrome

    As of 11 am this morning EST i have been unable to receive emails that have photos attached to them. I have checked and this is happening in both my gmail acocunt and in my firfox account - I run both of these through Chrome. I have also had unusual

  • Using SubReport to show Details of field grouped in Main Report

    Hi Experts I am creating a Crystal Report from BEx Query . In Report i have Created a group on Cost center field. & some other fields are in detail section. Suppose if i execute report then groups are A, B, C, D ...... Now further requirement  is  wh

  • How to change the width of the field?

    Hi all, I would like to decrease the width of a field on my report. But I can't do it in the Property palette. I am not able to change the width property. The width of the database column is varchar2(255). I do not want to decrease the length of the

  • How do I locate information using a changed password?

    How do I locate information using a changed password?  I can not retreive info because couldn't remember my password.  Tried to change password and now I can't retrieve all my info.  Is it still there?