Can't get to the next question...

Hello,
I am brand new to programming and Java and am trying to teach myself. Seems like an imposible task however I'm giving it a shot. I am trying to create a simple menu selection
quiz program to choose between topic and answer questions. This is what I have so far and
I'm not sure how to get to the next question. Can anyone give me any assistance please?
Thank you,
Mark
Here is what I have so far:
import java.util.Scanner;
class Quiz {
    public static void main(String args[])
          throws java.io.IOException {
          char choice;
          char quit = 'x';
          int questions = 1;
          int number;
          System.out.println("     Welcome to the Quick Quiz program!!!\n ");
          System.out.println("     Would you like to try the Math, Science or Art Quiz?\n ");
          System.out.println("     m > for math ");
          System.out.println("     s > for science ");
          System.out.println("     a > for art\n ");
          System.out.println("     or Hit x to Exit ");
          choice =(char) System.in.read();
        System.out.println("\n");
          switch(choice) {
               case 'm':
                 System.out.println("  Here comes the math quiz>>>\n");
                    System.out.println("  Question 1. What is 3 + 3?");
                 System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                 System.out.println("  Choose one (x to EXIT)\n");
                  choice =(char) System.in.read();
              if (choice == 'd') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                           System.out.println("  Next Question");
                           System.out.println("  Question 2. What is 15 x 2?");
                           System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                      }}}

I really appreciate your help but I guess I am still just a little too green, Would there be any way you could just give me some kind of outline on how to do that? My biggest problem is where to put everything. I'm only looking to try and get 5 questions to work for now. I know that I need to use the System.in.read(); statement to keep prompting the quiz taker after each question. I think I got a little further now.
Thank you,
Mark
import java.util.Scanner;
class Quiz {
    public static void main(String args[])
          throws java.io.IOException {
          char choice;
          char quit = 'x';
          int questions = 1;
          int number;
          System.out.println("   \nWelcome to the Quick Quiz program!!!\n ");
          System.out.println("     Would you like to try the Math, Science or Art Quiz?\n ");
          System.out.println("     m > for math ");
          System.out.println("     s > for science ");
          System.out.println("     a > for art\n ");
          System.out.println("     or Hit x to Exit ");
          choice =(char) System.in.read(); System.in.read
        System.out.println("\n");
          switch(choice) {
               case 'x':
                  System.out.println("  Sorry to see you go, Good Bye!!!");
                  break;
        switch(choice) {
               case 'm':
                 System.out.println("  Here comes the math quiz>>>\n");
                    System.out.println("  Question 1. What is 3 + 3?");
                 System.out.println("     a) 9\n     b) 3\n     c) 33\n     d) 6 ");
                 System.out.println("  Choose one (x to EXIT)\n");
                               do {
                                 choice =(char) System.in.read();
                  } while (choice == '\n' || choice == '\r');
              if (choice == 'd') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                        System.out.println("  Next Question");
                           System.out.println("  Question 2. What is 15 x 2?");
                           System.out.println("     a) 13\n     b) 30\n     c) 17\n     d) 60 ");
                       do {
                                 choice =(char) System.in.read();
                  } while (choice == '\n' || choice == '\r');
              if (choice == 'b') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'a' || choice == 'c' || choice == 'd') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                           System.out.println("  Next Question");
                           System.out.println("  Question 3. What is 12 - 4?");
                           System.out.println("     a) 16\n     b) 18\n     c) 8\n     d) 48 ");
                       do {
                                 choice =(char) System.in.read();
                  } while (choice == '\n' || choice == '\r');
              if (choice == 'c') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'a' || choice == 'b' || choice == 'd') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                           System.out.println("  Next Question");
                           System.out.println("  Question 4. What is 12 - 4?");
                           System.out.println("     a) 16\n     b) 18\n     c) 8\n     d) 48 ");
                       do {
                                 choice =(char) System.in.read();
                  } while (choice == '\n' || choice == '\r');
              if (choice == 'c') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'b' || choice == 'c' || choice == 'd') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                           System.out.println("  Next Question");
                           System.out.println("  Question 5. What is 16 / 4?");
                           System.out.println("     a) 4\n     b) 20\n     c) 21\n     d) 12 ");
                       do {
                                 choice =(char) System.in.read();
                  } while (choice == '\n' || choice == '\r');
              if (choice == 'd') {
                     System.out.println("  Correct!! " );
               } else if (choice == 'a' || choice == 'b' || choice == 'c') {
                        System.out.println("  Sorry, Wrong Answer\n\n");
                           System.out.println("  Thank You, This concludes your Quiz");
}

Similar Messages

  • Can't get to the next page in a pages document

    can't get to the next page in my pages document

    Is it a technical problem or writer's block?

  • HT1918 I'm having trouble viewing my account in iTunes, I'm signed in but can't get passed the next login window - any ideas?

    I'm having trouble viewing my account in iTunes, I'm signed in but can't get passed the next login window - any ideas?

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • Can't get beyond the flashing question mark

    I can't get beyond the flashing question mark on grey folder, on starting up.
    I have tried starting with option key down, but still get the question mark.
    I have tried starting with the command, option, P and R keys down but still get the same question mark.
    I have put the No 1 Installation disc in, and started holding down the C key. The disc was immediately ejected with no change on the monitor.
    Can anyone please suggest what else I could try?

    I would suggest taking the faulty hd out of the Mac, putting it in an enclosure and seeing whether you can get anything off it. Alternatively,there's an application called Data Rescue Data Rescuehttp://www.versiontracker.com/dyn/moreinfo/macosx/211375 that has an excellent reputation for retrieving data from a bad disk.
    If you do manage to get your data off, and then onto your MacBookPro, you should have no trouble putting it on a new drive in your iMac.

  • So you want to change your primary mail but can't get past the password question?

    Claudius,either you didn't read my post, or you jumped to conclusions. I had a skype account that was created using a microsoft account (NOT THE ACCOUNT I AM USING NOW). PURE MICROSOFT ACCOUNT NO OTHER ACCOUNT LINKING.I had to change the primary mail of that account.I was told "no can do" by skype support.I found that if I went to account settings and clicked on the link on the line below the one that said "MICROSOFT etc" (labeled something along the lines of "TV or Device") I got the opportunity to set the password of the "live:username" account (WHICH YOU COINCIDENTALLY HAVE TO DO IF YOU WANT TO USE SMART TVs ETC).Once that was done, I COULD SUCCESSFULLY DO WHAT SKYPE SUPPORT SAID WAS IMPOSSIBLE- I could change the primary mail address. once that was done, and NOT BEFORE, I linked the account to a facebook account as well, just to be sure I have more than one way to access the skype account. What caused you to get the impression that I was writing something else? furthermore this sentence - "The solution you described in your initial message isn't actually once since all the time you were operating on different account that weren't actually linked" does not make sense, I think you mis-edited it.and I need to point out that you are incorrect. I WAS NOT OPERATING ON DIFFERENT ACCOUNTS I WAS OPERATING ON ONE SKYPE ACCOUNT, THAT WAS CREATED USING A MICROSOFT ACCOUNT just like you say you recommend. I still don't know how you can misread my initial entry like that.  If you have a better solution to my initial problem - changing the primary mail of a skype account created throuth either a microsoft account or a facebook account, Please write a sticky to explain how to do it, and please inform skype support that Yes it can be done, and this is the way it is done. So far my "lucky shot" seems to be the only way to do it.     

    Hi!I ran into the same problem as a lot of other people seem to have done. I am changing ISP and because of that I have to change my mail address from my 10 year old [e-mail removed for privacy and security] to something else, this time I choose to use an outlook.com address in the hope that I will be able to keep that a bit longer. last week I realized that my skype account had my old expiring address as the primary mail, and that the primary mail was the only mail that skype will use for communication with me - I already had 2 other mail addresses in my skype profile (outlook.com and gmail). The skype account was created last summer using my microsoft account, and the microsoft account is the only means I have for accessing the skype account. So I logged on and opended the profile page, went on to edit the info and marked my outlook mail as the primary, clicked save and got the password question. I entered the password I use for logging on (ie the microsoft account password), but was told that the password was wrong. I tried everything and some more things, I spent 40-50 minutes on a text chat with skype support, only to be told that it can't be done and that the skype account was hard tied to the mail address I had used when creating the account, which I found very strange as I had used my microsoft account. yes, when I created the skype account, the only mail I had connected to the microsoft account was my "[e-mail removed for privacy and security]" mail, but I have since then, without any problems, been able to create an outlook.com address, and have that added, added a gmail account, set the outlook.com as the primary for the microsoft account and remove the "[e-mail removed for privacy and security]" address from the microsoft account. no problem.The problem is actually worse as the mail account will be free for use after april 1, which means that a person claiming that mail address will risk getting extremely confusing mails regarding a skype account they don't have, they will have difficulties creating a skype account of their own, AND they can take over my skype account (as they are the owners of the mail address) and I won't be able to stop them. How is that for security  Fortunately I spent 2 more hours and stumbled on the solution  This is where a normal scam artist would ask you to click on a link to a web apge that would releive you of all your money, but I won't do that. so, what is going on when you want to change the primary email, why isn't your password accepted??? It turns out that when you create a skype account using your microsoft account (and I guess  your facebook account), skype will actually create a "proper" skype user account as well, but they hide it from you, and you won't get a password set for it. It is the password for this "hidden" account you have to enter when you want to change the primary password It turns out that I was also unable to connect my facebook account to my skype account for the very same reason, but here it was more obvious, as I had to enter my skype username and passwor when connecting the accounts, and the microsoft account wasn't accepted there . so what do you need to do? well - those of you who have a smart tv (or some other device) that can't log on to skype using a microsoft account, have already done the work (provided you use that tv/device with skype) you log on to skype and open the account settings page, on the line below "microsoft account   [email protected]  unlink           change microsoft password" you'll see a line saying "TV or Device" or something similar (I have no idea what the english text is) here you have a link you can click on where you will be prompted to enter the password for your "live:username" account. once you have  done that you get instructions saying that for smart TVs etc, you enter "live:username" as the skye user and the newly created password as your password.The good news is that you now have 1) the identity of your skype user ("live:" and your name where the user name is the combined string "live:username" which in my case was "live:myname"); and 2) a password that is valid for your skype account. what I did next was open up the profile page, edit the profile, mark the outlook.com mail address asthe primary, click save and when prompted for the password, I entered the password I set in the previous step, and that's it, I now had a new primary mail (I got the confirmation mai sent to the new mail address right after I updated the info in skype). I also successfully removed my soon defunct mail address from the mail address list in my skype account, and I then connected my facebook account to my skype account (using live:myname ase the username and my shiny new password). So at the moment I have three different methods available to me when logging in to skype:- my microsoft account- my skype user (live:myname)- my facebook account.the ONLY thing to be aware of is that the name of the microsoft account, as presented on the account settings page in skype, still is my old [e-mail removed for privacy and security] mail address NOTE that this is a presentation issue only, someone thought that it was a good idea to save the original name of the microsoft account in the skype database and use that for presentation. It is NOT used when logging on, when you log on it will use the UID of you rmicrosoft account. if it disturbs you, you can always disconnect you rmicrosoft account from your skype account and reconnect it, and you should see the current mail address associated with the microsoft account. (this is safe to do because you have at least one other method to log on ) I hope that skype will amend their FAQ with this info. I did enter into a second chat with skype support, explaining what I díd to resolve the problem they failed to solve. so there it at least 2 people at skype support who know how to resolve the problem. -cheers,Anders 

  • Can't get by the security question

    I need to Reset My Security Question I can Not Make Purchases Without that security question Thank You Mrs. Desiree A Padmore
    <Personal Information Edited by Host>

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'. Please be patient waiting for the return
              phone call. It will come in time depending on how heavily the servers are being hit.
         2.  Call Apple Support in your country: Customer Service: Contact Apple support.
         3.  Rescue email address and how to reset Apple ID security questions.
    A substitute for using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • I can not get passed the security questions when I try to make a purchase.  I don't have a reset security questions icon

    How do I bypass the security questions to purchase with itunes.  I never answered them in the first place.  I don't have a reset security questions at the bottom of the page either

    You need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (107469)

  • IPhone 3G can't get past the security questions

    My old iPhone 3G has been off for a while, but I decided today to charge it up and get it running again so I could use the apps it has on it. It doesn't have phone service of course, but it works with wifi just fine. My problem is, when I try to install or update an app, I get the "security info required" dialog. Fine by me. So I let the screen load so I can answer my questions, but I think there is something wrong with it. Under "Choose questions" it merely shows two submit buttons. No matter how many times I navigate to the screen again by trying to install another app, or how many times I reset the phone, I still run into this issue. The Apple ID website won't work for me either. Everytime I try to fill in missing information on the security settings page, I click save, the page reloads, I try to nagivate away, and it tells me the information was not saved. Whether I ignore this, or choose save from this dialog, once I navigate away and go back, the information I had filled in is gone.
    Anyone have any advice? I'm not willing to pay money to have this resolved.

    Click here and use the form to contact Apple.
    (93801)

  • I am trying to change the apple id password and the security questions don't seem to be right. How can I get by the security questions?

    I am trying to change my apple password and it asks me 2 security questions.  The answer I gave are apparently not correct.  How do I get past this step?

    For Forgotten Security Questions / Answers...
    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    Or Email Here  >  Apple  Support  iTunes Store  Contact
    More Info >  Apple ID: All about Apple ID security questions
    Note:
    You can only set up and/or change a Rescue Email Before you forget the questions/answers.

  • I am trying to complete a form but can't get to the final drop down question as it is not displayed because it falls below where my screen ends.  i have tried changing the resolution but that doesn't work.  any suggestions?

    i am trying to complete a form but can't get to the final drop down question as it is not displayed because it falls below where my screen ends.  i have tried changing the resolution but that doesn't work.  any suggestions?

    brilliant
    google chrome works where safari doesn't on my macbook air.  many thanks
    i now have an embarrassing qu.  have dowloaded spider solitaire (sad!) and i can't add cards at the bottom of a column for the same reason - the display cuts short.  i have tried to extend it with the arrows in the bottom corners but it makes no difference.  any ideas?

  • HT4993 Can I buy 4 iphone 5s from 10pm-4am and get them the next day? or am I limited to a certain number?

    Can I buy 4 iphone 5s from 10pm-4am and get them the next day?

    he knows his ID , if he did all whats in the link he can get his password back ?
    how can i make him call applecare ? is there a way to speak to them from jordan ??
    i have been trying to reach any1 in apple so they can communicate and help my friend (us) to make him remember it .
    am not asking for the password or trying to get into the phone without using it , and i can take my money back though i need to help my friend as well since now he cant use it as well.
    thanks kil

  • How can I get past the questions, to change password

    How can I get past the questions, to change password

    Hello Cocoscafe
    If you have a rescue email address setup in your Apple ID profile, then you can reset the security questions. You would need to know those answers to get passed the screen to log in and verify.
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/ht5312
    The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so.
    Regards,
    -Norm G.

  • HT4623 I "updated" my iPhone4S 16gig this morning and can't get past the "Rescue Email" screen.  I entered emails as well as opted out.  I have gone back, but Apple ID Security insists I add security questions and mail.  HELP!

    I "updated" my iPhone4S 16gig this morning and can't get past the "Rescue Email" screen.  I entered emails as well as opted out.  I have gone back, but Apple ID Security insists I add security questions and mail.  HELP!

    Claudius,either you didn't read my post, or you jumped to conclusions. I had a skype account that was created using a microsoft account (NOT THE ACCOUNT I AM USING NOW). PURE MICROSOFT ACCOUNT NO OTHER ACCOUNT LINKING.I had to change the primary mail of that account.I was told "no can do" by skype support.I found that if I went to account settings and clicked on the link on the line below the one that said "MICROSOFT etc" (labeled something along the lines of "TV or Device") I got the opportunity to set the password of the "live:username" account (WHICH YOU COINCIDENTALLY HAVE TO DO IF YOU WANT TO USE SMART TVs ETC).Once that was done, I COULD SUCCESSFULLY DO WHAT SKYPE SUPPORT SAID WAS IMPOSSIBLE- I could change the primary mail address. once that was done, and NOT BEFORE, I linked the account to a facebook account as well, just to be sure I have more than one way to access the skype account. What caused you to get the impression that I was writing something else? furthermore this sentence - "The solution you described in your initial message isn't actually once since all the time you were operating on different account that weren't actually linked" does not make sense, I think you mis-edited it.and I need to point out that you are incorrect. I WAS NOT OPERATING ON DIFFERENT ACCOUNTS I WAS OPERATING ON ONE SKYPE ACCOUNT, THAT WAS CREATED USING A MICROSOFT ACCOUNT just like you say you recommend. I still don't know how you can misread my initial entry like that.  If you have a better solution to my initial problem - changing the primary mail of a skype account created throuth either a microsoft account or a facebook account, Please write a sticky to explain how to do it, and please inform skype support that Yes it can be done, and this is the way it is done. So far my "lucky shot" seems to be the only way to do it.     

  • I Have OSX 10.5.8 how can i get OSX 10.6 or can I jump to the next upgrade ?

    I Have OSX 10.5.8 how can i get OSX 10.6 or can I jump to the next upgrade ?

    In order to proceed you have to upgrade to Snow Leopard (10.6.8) first: you can purchase this from the online Apple Store. Note that you must have an Intel Mac in order to install this (and you should check the other requirements, listed in the Technical Specifications on the Store page, before purchasing). As you have Leopard it's possible your Mac is a PPC one: if this is the case you cannot upgrade any further.
    Once you have upgraded to Snow Leopard you can obtain Mavericks for free from the App Store in your Applications folder. The requirements for Mavericks are:
    OS X v10.6.8 or later
    2GB of memory
    8GB of available space
      and the supported models are:
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    Xserve (Early 2009)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    It is available from the Mac App Store (in Applications).
    If you are unable to install Mavericks (it won't let you if your Mac isn't compliant with the requirements) you may be able to install Lion.
    The requirements for Lion are:
    Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    2GB of memory
    OS X v10.6.6 or later (v10.6.8 recommended)
    7GB of available space
    Lion is available in the Online Apple Store ($19.99).
      You should be aware that PPC programs (such as AppleWorks) will not run on Lion or above; and some other applications may not be compatible - there is a useful compatibility checklist at http://roaringapps.com/apps:table

  • How can I get all the stuff from my old iPad 2 to my new iPad 2? I have an apple id and have synced and backed up my old iPad 2 regularly.

    How can I get all the stuff from my old iPad 2 to my new iPad 2? I have an apple id and have synced and backed up my old iPad 2 regularly.

    Sky is right you can restore the old backup and it will not affect the old iPad
    To make sure do this:
    1. If you have the old one then just turn off wi-fi and the iPad (that's just for your peace of mind)
    2. Put new iPad on airplane mode (just for no interruptions )
    3. Connect it (while it's on, don't shut it down)
    4. Follow prompts and when it asks if you want to setup as new or restore CHOOSE: RESTORE
    5. It will make its magic (just wait for it to sync, restarts, and finishes) it might ask you to update software if it does just accept
    6. You can rename your new iPad like that you can have a fresh back up
    7. ENJOY your new iPad
    ----------OR-----------
    1. Do the above steps 1, 2, 3.
    2. On step 4 you can choose to set up as new
    3. Then you can choose what to sync on it (click on iPad on the left panel then the tabs on top you choose what you want on it (you can also do that if you restore)
    4. Follow steps 5, 6, 7.
    ****If you don't have your old iPad you can remove it from your account ****
    ****Also when they sync it to a new computer it will setup as new unless they had an old one then they will restore it their old one****
    ****if you have it connected with your MobileMe or iCloud and you have the find my _____ you can also wipe it as soon as it comes online****
    LET ME KNOW IF YOU HAVE ANY QUESTIONS OR CONCERNS
    AGAIN ENJOY YOUR NEW IPAD!!!

Maybe you are looking for

  • How do i add a website as trusted in safari

    How do I add a trusted site in Safari? I need to add my work websites.

  • ITunes 32 bit or 64 bit?

    Greetings, I have windows 7 64 bit and have iTunes 9.2 32 bit installed, I woulkd like to use the 64 bit version of iTunes 9.2, my question is, can install the 64 bit version over the top of the 32 bit version, or is a separate 64 bit version install

  • Error while trying to install WS2012 R2 Essentials evaluation copy

    While trying to install (Setup.exe) the evaluation copy of Windows Server 2012 R2 Essentials which I downloaded from the Microsoft site, after clicking on install and the temporary files start to unpack, I received the following error: Windows cannot

  • I would like to take over the screen of my ipad with my PC (not wireless!)

    I would like to take over the screen of my ipad with my PC with the usbcable, not wireless! This is to reproduce some images from an app on my Ipad with the beamer attached to my PC. Can anyone help me? Thanks

  • Freezes while downloading

    Hi, We've just bought a new 60G iPod, and are having trouble putting stuff on it. We've bought it primarily for keeping and transporting photos, with the whole music/video/storage things as being a bonus. The problem is that when I want to sync my ip