I am sure that I am missing something very simple Please Help

I have all but finished this little program , but for some reason I am getting an error on the last "System.out.println" statement.
public class ABCInput
     public static void main(String[] args) throws Exception
          char choice;
          while(choice == 'A' | choice != 'B' | choice == 'C' | choice == 'Q')
          System.in.read();System.in.read();
          System.out.println("Please enter one of the following: A, B, C, or Q.");
          choice = (char)System.in.read();
               if (choice == 'A' || choice == 'B' || choice == 'C')
                    System.out.println("Good Job!");
               else if(choice == 'Q')
                    System.out.println("Have a nice day!");
                    System.exit(0);
               System.out.println("Entry must be A, B, C, or Q(quit)");
Error messages:
<identifier> expected
               System.out.println("Entry must be A, B, C, or Q(quit)");
cannot resolve symbol
symbol : class out
location: class java.lang.System
               System.out.println("Entry must be A, B, C, or Q(quit)");

It looks like your println statement is outside of the 'main' method.
Try this - I've made a few changes, which seems to work OK
import java.io.*;
public class ABCInput
  public static void main(String[] args) throws Exception
    String choice;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    do
      System.out.println("Please enter one of the following: A, B, C, or Q.");
      choice = br.readLine().toUpperCase();
      System.out.println(choice);
    } while("ABCQ".indexOf(choice) < 0);
    if (choice.equals("A") || choice.equals("B") || choice.equals("C"))
      System.out.println("Good Job!");
    else if(choice.equals("Q"))
      System.out.println("Have a nice day!");
    System.exit(0);

Similar Messages

  • I've been silly and must have missed something...please help!?

    Hi there,
    Right, deep breath.
    I've had the snow leopard install disk for months (upgrading from 10.5.8) and have not been able to install for various reasons.. I get constant error msg's that seem to vary with install attempts. Anyway my focus is not on them today as I installed successfully for the first time... eh not quite.
    I got myself an external HD and backed everything up using superduper. worked great. Then I booted to the snow leopard dvd, did a fresh install by clearing my drive in disk utility and hooray! I was navigating around SL for the first time. But it was brief.
    I then restarted and booted from my external drive and used superduper to restore all files back onto my internal HD and after hours waiting I restarted to find I'm stuck again with 10.5.8!!!!!!
    Now I know I must of done something really quite stupid here but how can I do pretty much what I described but keeping SL the next time around. It's 4am here and i cant think straight so any help would be greatly appreciated. Thanks. Jason.

    I am not sure if got all the details.. when you boot from the external you will be on 10.5.8 b/c that is what was backed up now when restore the information it is probably an option so you won't restore the boot/system files have you checked all the options?

  • Podcasting. am i missing something here? please help.

    Hi everyone,
    I'm a little confused with how to podcast. I have some videos that I have made in Final Cut Pro and exported to Ipod files that are sitting on my desktop. How do I podcast them. I have read the info on How to Podcast and am stumped on these RSS feed links. Do podcasts work like "youtube" or do I need to set up a website to put them on to have a URL?
    Am I going about this the wrong way.
    Please let me know if I can podcast my video's from the desktop of my Mac.
    thanks for your patience and time in advance.
    Kris

    P.P.S.
    Here are the instructions from iWeb's "Help" menu about "Submitting a podcast to the iTunes Music Store":
    You can use iWeb to submit your podcast series to the iTunes Music Store, so that it appears on the Podcast page when people visit the music store online. Visitors to the music store can listen to or download your podcast for free.
    Note: Your website visitors can listen and subscribe to your podcast directly from your website, even if you don’t submit the podcast to the public iTunes Music Store.
    To submit a podcast to the iTunes Music Store:
    In the site organizer, select the main blog page or the blog entry that contains the podcast you want to submit.
    If the Blog & Podcast Inspector isn't open, click Inspector in the toolbar (or choose View > Show Inspector), click the Blog & Podcast Inspector button, and then click Podcast.
    Enter information about the podcast series or episode.
    Artist: Include the author or artist of the series or episode.
    Parental Advisory: To help alert parents to content that may be inappropriate for children, iTunes provides Clean and Explicit labels, which you can add to your podcasts (or you can choose to have no label).
    Contact email: You can provide the music store with a way to contact you or your podcast’s artist. This information is not visible in iTunes.
    Make sure the "Allow Podcast in iTunes Music Store" checkbox is selected and then choose File > Submit Podcast to iTunes.
    In the Submit window, enter the information you want to include in your podcast.
    Some information—such as the fields you completed in step 3—may already appear in the Submit window.
    If you have artwork you want to appear with your podcast, drag it to the graphic placeholder at the top of the Submit window.
    Click “Publish and Submit.”
    In the iTunes window, follow the onscreen instructions to complete the submission process.
    Note: When you submit a podcast to the iTunes Music Store, all your iWeb sites are published.
    It may take a while for the podcast to appear in the iTunes Music Store.

  • I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd.After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality?

    I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd. After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality? or any other exporting alternatives?

    Hey Z,
    Thank you for the tip on exporting by media browser (large) from imovie. But of course, if it's not one thing it's another. Now that I figured how to export a large file from imovie, I have an idvd issue. I followed the instructions for burning from idvd and changing the encoding to professional quality and the burn speed to x4, but I am receiving an error that states the following,
    Your project exceeds the maximum content duration. To burn your DVD, change the encoder setting in the Project Info window.
    Project:
    - total project duration: 79:04 minutes
    - total project capacity: 4.327 GB (max. available: 4.172 GB)
    Menus:
    - number of menus in project: 1 menus
    - total menu duration: 0:39 minutes
    - total menu capacity: 37.370 MB
    Movies:
    - total movies duration: 78:25 minutes
    - total movies capacity: 4.291 GB
    I have searched in the idvd forum for similar issues and I am stumped at this point. I have tried deleting the encoding assets and re launching idvd with the changed preferences, and still the same error. I know you mentioned something about free hard drive space available, and I have very little left. 4GB to be exact due to massive hours of non-edited footage. I am not sure if this is why, but I do not recall ever needing free space to burn memory onto a separate dvd. I would be more than happy if I am wrong, and it would be a quick fix. Otherwise, the technical nightmare continues. It's all a learning process and your expertise is greatly appreciated! Thanks in advance.

  • Using Adobe Reader, I cannot open any adobe documents, Message indicates missing plug-ins. Please help... Thank you

    Successfully downloaded Reader on to my PC (Windows 7 Home Premium 64 bit).    However, I cannot open any adobe documents,    Message indicates missing plug-ins. Please help... Thank you,
    Theyankfan

    Hey Joseph Curcio,
    You might be viewing the PDFs in your browser only where Adobe Reader plug-in is disabled.
    Please try opening the PDF file using Adobe Reader and then check.
    Let me know in which browser are you trying to view the PDFs so that I can help you out enabling the required plug-ins.
    Regards,
    Anubha

  • HT1222 I have 10 gb more than what the update requires available and it still prompts that I don't have enough storage please help as I'm operating of of iOS 5 and I'm ready to smash my iPad

    I just purchased more storage and still prompts that I don't have enough storage please help as I'm operating of of iOS 5 and I'm ready to smash my iPad

    Have you tried doing the Update using iTunes on your Computer.?
    See the Using iTunes Section Here...
    How to update your iPhone, iPad, or iPod touch
    Make sure you have the Latest Version of iTunes (v11) Installed on your computer
    iTunes free download from www.itunes.com/download

  • When i open iphoto i see my photo's for 1 second and then they are gone .The photo's are still there but i can see them only on the bottom or top of my screen when i try to open them i get a sign that it is not possible.Can somebody please  help me?

    when i open iphoto i see my photo's for 1 second and then they are gone .The photo's are still there but i can see them only on the bottom or top of my screen when i try to open them i get a sign that it is not possible.Can somebody please  help me?

    Have you upgraded to iPhoto 9.6 for compatibility with Yosemite? If not, try that first.
    It looks like iPhoto has lost the connection between the thumbnails and the original image files.
    This can be caused by a corrupted iPhoto library, or the originals have been deleted or moved.
    Try first to rebuild your iPhoto Library:
    If you do not have a current backup of the iPhoto library, make a copy of the library, but do not overwrite any previous backup.
    Launch iPhoto with the ⌥⌘-key combination (option-command) held down.
    Select "rebuild" from the first aid panel.  This may take a while for a large library.
    Can you now see your photos again?
    If not, rebuild the library with iPhoto Library manager as described by Old Toad:            Re: iphoto crashed

  • I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.

    I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.

    See:
    * http://kb.mozillazine.org/Recovering_a_missing_profile
    * http://kb.mozillazine.org/Profile_in_use
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • I got a $50 iTunes gift card for Christmas that doesn't seem to work. Everytime I enter the code, a box pops up that "Code entered is not valid". Please help me?

    I got a $50 iTunes gift card for Christmas that doesn't seem to work. Everytime I enter the code, a box pops up that "Code entered is not valid". Please help me?

    iTunes Store: Invalid, inactive, or illegible codes

  • I have restored my iphone but it has been 2days saying that the activation server is not available. please help me.

    i have restored my iphone but it has been 2days saying that the activation server is not available. please help me.

    That is almost always because the phone was hacked to illegally unlock it. Contact the carrier it's locked to and ask about having it legitimately unlocked. If they will not do so, you will not be able to activate that phone.

  • I am a macbook pro user form last 2 yrs, recently i upgraded to Mountain Lion from Snow leopard. Since then  operational  speed is a major concern. Now It has crashed so very badly that I am scared of my data.Please help me.

    I am a macbook pro user form last 2 yrs, recently i upgraded to Mountain Lion from Snow leopard. Since then  operational  speed is a major concern. Now It has crashed so very badly that I am scared of my data.Please help me.

    Reinstalling Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Hello my iphone 3gs just been stolen how can i block the iphone and how could i track it i don't know for sure if i have find my iphone? please help i got many accounts on it and i don't have a passcode :((

    hello my iphone 3gs just been stolen how can i block the iphone and how could i track it i don't know for sure if i have find my iphone? please help i got many accounts on it and i don't have a passcode :((

    It was never free for the 3GS.
    It is if the initial sign-up is done on an iPhone 4, iPad or iPod touch 4th gen.
    From http://support.apple.com/kb/HT4436:
    After I sign up for Find My iPhone for free, can I use it on other iOS devices?
    Yes, if your devices are running iOS 4.2. For example, you can sign up for Find My iPhone for free on your iPad and use the same account information to sign in to MobileMe on your iPhone 3GS and turn on Find My iPhone.

  • When attempting to convert pdf to word doc, I continually get "An error occurred while signing in" despite the fact that I'm already signed in.  Please help if you can?

    When attempting to convert pdf to word doc, I continually get "An error occurred while signing in" despite the fact that I'm already signed in.  Please help if you can?

    Hi lorrelaws,
    Do you receive that error when you try to sign in via Reader? If so, try signing in via the web interface. Did that do the trick?
    Let us know how it goes.
    Best,
    Sara

  • I am unable to access information from the internet as I am unable to install the lastest adobe flash player that is now required.  Can you please help?

    I am unable to access information from the internet as I am unable to install the lastest adobe flash player that is now required.  Can you please help?

    I fould a hack that makes the sites think you have the latest (Intel) version of Flash installed. So I installed it & it works with Firefox, TenFourFox & Safari. Here's the info.
    Download this http://www.steelbin.com/FPforFBPPC.zip to your desktop, unzip it, and replace the current Flash Player plug-in which is in your main/Library/Internet Plug-Ins folder, (not the user Library). Save the old one just in case this one doesn't work.
     Cheers, Tom

  • HT4623 I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.

    I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.
    Kindly Activate my phone.

    Rajan Gupta wrote:
    ...it is continuously showing an error.
    See here  >  http://support.apple.com/kb/TS3424
    Also see this discussion.
    https://discussions.apple.com/message/21189708

Maybe you are looking for

  • Error 500--Internal Server Error when using BI Publisher within OBIEE 11g

    I'm using OBIEE 11.1.1.6.2BP1 on a Linux x86-64 server and it has been working just fine. We recently started playing around with the BI Publisher component of that installation and every time i go to http://hostname:port/xmlpserver and try to log in

  • Trying to publish; Muse can't sign in to BC

    So I press 'publish' to get my newest site online, and the familiar 'Signing into Business Catalyst' window comes up. However, Muse appears to get stuck at this threshold every time, as the window never closes, it is eternally 'signing in', and nothi

  • "Skype can't connect. Get help fixing this problem...

    Well, I downloaded Skype. Then, i sign in to my account. And an error pops up on my computer screen that said "Skype can't connect. Get help fixing this problem". Someone help me fix this? Solved! Go to Solution.

  • How can i listen to events happening in the illustrator?

    Hi, I am using the extension builder to intract with PS, e.g. i can listen to  PS events by registering  in CSXSInterface.instance.evalScript and execute action on PS by using Photoshop.app.executeAction. I need to do the same for Illustrator, could

  • Duplicate Contact information in IT 1002 for Curriculum

    Hi All, While creating a Curriculum in LSO, for the Description Infotype screen is displaying the Contact Information twice. This is happening for the Delivery TYpe - Web based Training also. But not for Class Room Training !!! Please let me know if