Error control problem?

hey everyone, i wont lie this is a school lab, but for the lab i have all the prerequisits complete, this is more a question i was wondering about because i was trying to add a little extra to it. Well i want to add a while loop saying while the answer isn't this or this or this or this then say its an error and repeat the input, but instead every time i add something i get an error and it just doesn't seem to work? I've tryed a few different ways to do this, and it all works fine with out the while loop , and if i put just one condition into the while loop, but if i put more than one condition it doesn't seem to like it? Any help would be great, thank you all in advance
import java.lang.*;
import java.util.Scanner;
public class whats_the_math {
     public static void main (String args[])
          Scanner in = new Scanner (System.in);
          String mathNumS;
          char mathNum;
               System.out.println("\nEnter one of these to see what does what!\n+, -, *, /, %\n\nEnter Exit to Finish =]");
               mathNumS = in.nextLine();
               mathNum = mathNumS.charAt(0);
//This is what im having problems with gettnig to work, the multiple conditions in the While loop. With just one condition it works fine but i cant seem to ge tit to work
// With multiple loops, if anyone could point me to some info or lend a hand that would be great because all the stuff ive foudn for while loops include just one condition
               while(mathNum != '+' || mathNum != '-' || mathNum != '*' || mathNum != '/' || mathNum != '%')
                    System.out.println("Error");
                    mathNumS = in.nextLine();
                    mathNum = mathNumS.charAt(0);
// This is where my problem stops, because with out it everything seems to work fine, so im guessing its seomthing to do with just this while loop i have because it doesnt
// seem to acknowledge the right answers and just gets stuck in the loop i guess?
                    switch(mathNum)
                         case '+':
                              System.out.println("This is Addition!\n");
                              break;
                         case '-':
                              System.out.println("This is Subtraction!\n");     
                              break;
                         case '*': case 'X':
                              System.out.println("This is multiplication!\n");
                              break;
                         case '/':
                              System.out.println("This is Division!\n");
                              break;
                         case '%':
                              System.out.println("This is modulus operation!\n");
                              break;
}

sorry the specific problem is, when i add the while loop, and when i add more conditions into it with the || operator, it doesnt work for me, say i put while(mathNum != '+' || mathNum != '-') and i use the switch statement afterwards like in my code i have posted, then it ignores even the right answer i put in, so its always giving me the error in the loop i added and not carrying on with the rest of the program. ill repost my code using the code button( sorry im new to the forum and didnt see it before) i commented around the part thats not working right aswell, thanks again
import java.lang.*;
import java.util.Scanner;
public class whats_the_math {
public static void main (String args[])
Scanner in = new Scanner (System.in);
String mathNumS;
char mathNum;
System.out.println("\nEnter one of these to see what does what!\n+, -, *, /, %\n\nEnter Exit to Finish =]");
mathNumS = in.nextLine();
mathNum = mathNumS.charAt(0);
//This is what im having problems with gettnig to work, the multiple conditions in the While loop. With just one condition it works fine but i cant seem to get it to work
// With multiple loops, if anyone could point me to some info or lend a hand that would be great because all the stuff ive found for while loops include just one condition
while(mathNum != '+' || mathNum != '-' || mathNum != '*' || mathNum != '/' || mathNum != '%')
System.out.println("Error");
mathNumS = in.nextLine();
mathNum = mathNumS.charAt(0);
// This is where my problem stops, because with out it everything seems to work fine, so im guessing its seomthing to do with just this while loop i have because it doesn't
// seem to acknowledge the right answers and just gets stuck in the loop i guess?
switch(mathNum)
case '+':
System.out.println("This is Addition!\n");
break;
case '-':
System.out.println("This is Subtraction!\n");
break;
case '*': case 'X':
System.out.println("This is multiplication!\n");
break;
case '/':
System.out.println("This is Division!\n");
break;
case '%':
System.out.println("This is modulus operation!\n");
break;
}

Similar Messages

  • Trying to upgrade to 10.6 so my iPhone could synch...I'm getting this error message "Problem with this Windows (XP) Installer package.  A program required for this install to complete could not be run."  Any ideas?

    I had iTunes 10.2.1.1 but needed to upgrade to 10.6 so my iPhone could synch...I'm getting this error message "Problem with this Windows (XP) Installer package.  A program required for this install to complete could not be run."  Any ideas?

    This has been fixed.  Answer is that I needed to go to "Apple Software Update" and repair it.  (From my Control Panel).

  • Error out problems with measuring frequency VI

    I am having some error out problems with measure frequency VI. The instructions is change error out from indicator to control but does not work. Anyone can help? The VI is attached
    Attachments:
    Measure Frequency VI error.vi ‏27 KB

    This VI does not have an error out. Obviously, you replaced a subVI that did have an error out with this one, otherwise you would not have been able to create this wire.
    Simply remove the wire or save the subVI with another name then modify it to have the error out that you are looking for.
    Hope that this helps,
    Bob
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • User Account Control Problems with Premier Elements 7 32 bit in 64 Bit Windows 7

    I found User Account Control Problems in other forums but didn't see much in Premiere Elements, so I hope this helps others who may be having problems with 32 bit programs in a 64 bit computor. When I first got my 64 bit I didn't have problems.
    Back in February I bought a Quad Core Desktop with Windows 7 64 bit. Haven't been on the forum for 7 months since I wrote in regarding importing video with the Pyro AV Link (Premiere Elements Tips and Tricks). I was having problems importing video which started after March 28 sometime, as that was the last time I didn't have a problem importing VHS. Took me a few months off and on to find out what worked.
    I started uninstalling Windows updates and any programs I had installed back to that point in time. Checked after uninstalling each item. The capture screen would come up on a delayed basis but clicking on capture did nothing. Although no driver is required for IE1394 (so they say) I read where some people using the Legacy driver had fixed some problems, so I switched to the Legacy. Seemed to work great (for a few minutes).
    I had even uninstalled and reinstalled PE7 but no difference. Finally I noticed a shield in the PE7 Desktop icon. Thats weird. Never had that before. Just decided to show up after I had done all of the stuff I mentioned. Turns out at some point in time since I've had the computor Windows 7 decided to flag my 32 bit program as misusing the 64 bit system. User Account Control. I never bothered too much with UAC and just clicked on the yes box wen it popped up asking if I wanted this or that to take control of my computor. I tried using the minimum setting for safety reasons, and then finally turned User Account Control off. Bingo! PE7 capture works again and still working.
    While I am not recommending that people arbitrarily turn UAC off, this appeared to be my problem. I would recommed that they try turning it off before uninstallin a bunch of stuff. Having a restore point may or may not have been a fix for me. I think one of the Windows Updates caused the problem but I am not going to uninstall any more stuff at this point, I have not been back on the internet or installed any more updates in my desktop. I am going to use my laptop for internet and used the desktop for video.
    I am guessing this could be a problem for any 64 bit systems trying to use 32 bit programs. IE: XP,Vista,Windows 7 64 bit. In Vista there is also Data Execution Prevention (DEP) which you can turn on or off, supposedly to prevent misuse of memory (as I understand it), but Win7 either doesn't have it or I haven't found where it's located.
    Maybe this has been covered in the forum somewhere and I missed reading it. Hope I am not too confusing. Anyway, whatever feedback you guys have would be great.  

    John,
        Thanks for your answer, and I did check out the link you suggested. However, I have Windows 7 Home Premium as most people have I think, and the XP program was not available. I started with Vista and now have Win 7. I never could navigate around in XP anyway so am content to just leave User Account Control off.
        Interesting side note to turning UAC off is that my desktop seemed to be using more of the CPUs, where half of them were "Parked" as I wrote in also about 7 months ago when I 1st got my desktop. I am pleased to say that video processing seems to go quicker with UAC off. Have to observe things some more to confirm.
        I just thought if others were having problems after installing Windows Updates and leaving UAC off worked then they could possibly pinpoint a problem.

  • OWA error: A problem occurred while you were trying to use your mailbox (Exchannge 2010 SP3)

    Hi!
    I have several mailboxes that are was moved from Exchange 2007 to Exchange 2010.
    Sometimes occurs a problem: in OWA may appears error "A problem occurred while you were trying to use your mailbox" when selecting interface elements (such as "Options", "Public Folders",
    "Reminders"). After this error user cannot access to mailbox through OWA during 10 minutes. The error "A problem occurred while you were trying to use your mailbox" appears in top of browser window on any computers. This behavior is manifested
    in any browser, but it can not be associated with any particular event.
    Access to mailbox through Outlook or through mobile devices (ActiveSync) continues to work fine in this time.
    The errors in Application log on Client Access Server is absent (including error with EventID 9646). ExBPA is not showing anything specific to that error message. Test of OWA connectivity working successfully.
    In the logs of IIS finded records:
    2014-08-26 09:23:01 172.16.0.31 GET /owa/ &ex=UE:Microsoft.Exchange.Data.Storage.TooManyObjectsOpenedException 443 DOMAIN\username 172.16.4.218 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+InfoPath.3;+.NET4.0C;+.NET4.0E;+.NET+CLR+1.1.4322;+MS-RTC+LM+8)
    200 0 0 31
    Someone faced with such issue?
    Have ideas to solve the issue?

    Hi,
    Event 9646 occurs if a MAPI client opens more than the default value. You can follow the steps below for troubleshooting:
    1. Run regedit, and then click OK.
    2. Expand the following registry subkey:
       HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem
    3. Right-click ParametersSystem, point to New, and then click  Key.
    4. Type MaxObjsPerMapiSession, and then press ENTER to name the new subkey.
    5. Right-click MaxObjsPerMapiSession, click New, and then click DWORD Value.
    6. Type Object_type, and then press ENTER to name the object.
    Note: Object_type is the name of the object type in the error message that is mentioned in the "Symptoms" section.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • I am not able to open iCloud from pc, error is "problem with the server". what should I do?

    I am not able to open iCloud from pc, error is "problem with the server". what should I do?

    Go to Settings>General>Restrictions>Accounts (near the bottom) and set this to Allow Changes.  You will then be able to access Settings>iCloud again.

  • Error logging problem:

    error logging problem:
    I would like to implement an error logger that will do the following tasks when a error/exception arrises:
    - surpress the DacfErrorPopupLogger
    - alert the user that an error has occured with a simplified popup (create a global listener then use the ErrorAttributes to create the text of the popup)
    - log the error in a file with a timestamp and all error information
    - later if the above works....i would like to add the error attributes (time stamp, error type) to a oracle object/ Jdev domain.
    Questions:
    What is the best technique to use....errorManager, error logger ...?? combination
    How do i use the error manager to register listners for the errors?.
    In the following code i am not sure how to access the ErrorsAttributes[] array that is returned by loggerReader.getErrors();
    Any general tips places to find sample code on errorManager or associated interfaces, will be appreciated
    I used the OutPutStreamLogger to write error information to a FileOutputStream then a loggerReader to get the error attributes from the file. The reason i went in this direction is because i found some smple code on the outputStream logger.
    package DACVideo;
    import oracle.dacf.util.errorloggers.*;
    import oracle.dacf.util.errormanager.*;
    import oracle.dacf.util.errorloggers.InputStreamLoggerReader.ErrorAttributes;
    import java.io.*;
    * A Class class.
    * <P>
    * @author Adam Maddox
    public class ErrorLogger extends Object {
    static OutputStreamLogger logger = null;
    static InputStreamLoggerReader loggerReader = null;
    public ErrorLogger() {
    System.out.println("==============ErrorLogger Created==============");
    //remove default error logger (popup logger)
    ErrorManager.removeErrorLogger(ErrorManager.findLoggerByName(DacfErrorPopupLogger.NAME));
    try
    logger = new OutputStreamLogger(new FileOutputStream("out.dat"));
    loggerReader = new InputStreamLoggerReader(new FileInputStream("out.dat"));
    catch(java.io.IOException e)
    System.err.println("Error!");
    try
    ErrorManager.addErrorLogger(logger);
    catch(NameAlreadyRegisteredException e)
    System.err.println("A Logger with this name is already registered.");
    private void closeErrorLog()
    //close the OutputStream, to force flushing
    logger.closeOutputStream();
    ErrorManager.removeErrorLogger(logger);
    public static void showErrorLog()
    ErrorAttributes[] errorArray = loggerReader.getErrors(); <<<<CANNOT GET ERROR ATTRIBUTES ??
    null

    JDev could you help??

  • Oracle error - Open problem

    hi friends,
    on accessing the database i get this following error:
    Open Problem - ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Execution Problemnull
    How can i resove it...

    Here's a wild idea.... check the Oracle site/documentation for suggestions ?

  • Control problem

    I create a swf by Flash locally which point to a flv in a
    remote flash media server, FLVplayback component included, it work
    fine locally. Uploaded to FMS3, played without the control problem,
    such as Play/Pause, seek bar.
    Is it something I need to configure in FMS, or in Flash.
    Please advice.
    Thanks!

    Between version 1.0 and 2.0 the API in the JBCL controls has
    changed. We are actually moving away from JBCL completely (please
    do send feedback if you have a comment on that) to a Swing and
    Infobus standard based library of visual JavaBeans.
    You will still be able to use the JBCL controls in JDeveloper
    2.0. The best thing to do is to take your 1.x based application
    AND the 1.x based JBCL.ZIP file into your new environment. This
    way you will be able to continue to use these apps and
    components. Taking the 1.x JBCL.ZIP file will make sure you have
    the same version of the JBCL library that you were used to in
    version 1.x.
    Hope this help,
    -Roel.
    Hans Duijn (guest) wrote:
    : Hi,
    : I developed an applet in v1 that worked fine. I tried to
    rebuild
    : the applet in v2 but some problems occured. One, The
    : ChoiceControl populated with the method
    : 'ChoiceControl1.setItems' but in v2, this does not work till a
    : explicitly called 'queryDataset.open'. Is the way to do it or
    do
    : I have to use special properties for the
    dataset...and...second,
    : I'm using an listControl that, in response to a selected item
    in
    : the ChoiceControl, changes frequently. No new list appears till
    : I update the applet the hard way (hide it and bring it to
    front)
    : or click the mouse on the hidden items. 'listControl.repaint()'
    : has no result. Am I doing something wrong? It worked in v1...
    : and third...when can we expect the final version 2?
    : Thanx.
    null

  • J1INCHLN when should I use error control mode checkbox

    Hi Experts,
    I am using t-code J1INCHLN for creating remittance Challan.
    But in ECC6, EHP 5 there is new functionality added & no documentation available for same.
    There is one field with tick option called Error Control Mode.so when should i use this functionality.
    Can anyone help on this?
    Thanks and Regards,
    Sameer

    HI
    Please refer the note no :  1567443
    Manual Control in J1INCHLN to change currency key/doc type
    "After this, if you will run J1INCHLN, you will get a checkbox at the end
    with 'Error Control Mode' which will be selected by default. If you want
    to change document type, currency or rate during processing, you should
    uncheck it else it will take you to the last screen."
    I hope note is allready available in your system hence you are getting above cheeck box.
    If you want to change the document type and currency or rate during posting then you need use the check box.
    Regards
    Madhu M

  • Error in problem  class important

    Hi Gurus,
    we are facing problem while activating the transferstructure
    when are activating using the program:
    RS_TRANSTRU_ACTIVATE_ALL
    we are getting
    error in problem class important.
    All Thaughts are considered.
    Regards,
    Ajay.

    Need tyo make sure the problem is with the query/workbook are general issue with all workbooks/query.
    1. Make sure the base query of work book is still executable. RRMX/RSRT.
    2. Execute the work book in Bex/Excel and look for definition of workbook; there might be some thing in the workbook referencing other than base query.
    3. If other workbook are also not working? need to check if other users have same issue.?
    Hope this will help to narrow the problem.
    Gopi

  • ERROR 101 PROBLEM

    Error 101 (problem extracting the installer): Creative Suite 6 Master Collection Trial
    This question is Not Answered.
    21-May-2012 19:26
    #trial_download #creative_suite_6   
    I have 400 gb of free space. 32 gb of ram.Im using Win7 64bit SP1. Have downloaded to the default folder and "tried the solutions" on the adobe troubling shooting guide. There seems to be alot of users with the same issue. Please advise.

    If you are continuing to have an error 101 after the steps you have listed then I would recommend initiating a direct download.  You can find more information on how to initiate a direct download at http://forums.adobe.com/thread/981369.

  • I have purchased adobe photoshop element 10 editor today but been having problem downloading.. it says error and problem on verification. Also tried contacting customer support but couldn't get through? can I still get my money back?

    i have purchased adobe photoshop element 10 editor today but been having problem downloading.. it says error and problem on verification. Also tried contacting customer support but couldn’t get through? can I still get my money back?

    Hi ...
    If you have anti virus software installed, you need to disable that in order to download apps.
    Apple's policy clearly states that, "all sales are final" >  iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    edited by:  cs

  • Priemere Pro consistantly crashed upon export, I cleaned media cache and that seemed to help. Now export errors unknown problem... read to uninstall and reinstall and now I can not open up PPCS5

    Here is my problems with Premiere Pro CS5
    When I export a project... the computer crashes.
    I was able to get a tech chat and they would clean the media cache
    so I did that.
    Then, I got an export error "unknown problem" I then read in a forum to uninstall and reinstall Premiere pro
    Now on my very nice relatively newer IMAC, when I go to applications to open it... I can not find a purple tab to open it. It just has a presets folder, then open that and it has styles, templates, textures but, now little purple Pr to open or drag to my dashboard.
    Help PLEASE!!! I have wasted 20 hours of editing time, and work because of crashes, and problems.

    Here is my problems with Premiere Pro CS5
    When I export a project... the computer crashes.
    I was able to get a tech chat and they would clean the media cache
    so I did that.
    Then, I got an export error "unknown problem" I then read in a forum to uninstall and reinstall Premiere pro
    Now on my very nice relatively newer IMAC, when I go to applications to open it... I can not find a purple tab to open it. It just has a presets folder, then open that and it has styles, templates, textures but, now little purple Pr to open or drag to my dashboard.
    Help PLEASE!!! I have wasted 20 hours of editing time, and work because of crashes, and problems.

  • Error "DATABASE PROBLEMS WITH TABLE MC11VA0HDRSETUP"

    Hi Friends,
    I got the following message when am trying to delete the setup tables.
    " Error DATABASE PROBLEMS WITH TABLE MC11VA0HDRSETUP"
    Am trying to delete the setup tables for application '11', but it gives me the above error. I have gone throug similar threads but it did not solve my issue.
    Please can anyone provide a solution.
    system detials:
    R/3 release    - 4.6c
    PI                 - 2004_1_46c
    SAP_BW      - 30B
    PI_BASIS     - 2003_1_620
    Any information will be appreciated
    Thanks,
    VBR

    Hi Kishor,
    Thanks for your reply.
    I have gone through that SAP Note 456102 and it was not of much help for our issue because we are ahead of PI that is mentioned in the note.
    Can you send your email id so that i can forward the error screenshots.
    Regards,
    VBR

Maybe you are looking for

  • Safari 4 breaks Automator apps

    MBPro 10.5.7 Safari 4.0.2 Automator 2.0.3 Simple case: Apple's own "Tab Left", "Tab Right" speakable commands no longer work. They worked fine with Safari 3.x.x These files are located in ~/Library/Speech/Speakable Items/Application Speakable Items/S

  • Count distinct derived measure on SCD type 2 dimension

    Hi, I have 2 dimension tables with SCD type 2 and one fact table : DIM1 : DIM1_SURR_KEY DIM1_NAT_KEY DIM1_PROPERTY1 DIM1_PROPERTY2 EFFECTIVE_DATE EXPIRATION_DATE DIM2 : DIM2_SURR_KEY DIM2_NAT_KEY DIM2_PROPERTY1 DIM2_PROPERTY2 EFFECTIVE_DATE EXPIRATIO

  • Not a multipart form upload

    I created a jsp that uses my extended version of editcurrentrecord (which creates an html form to insert a new record) and a rowsetbrowser. I am able to insert new records when running the jsp in jdev 3.1 but when I deploy it to ias and try to insert

  • Help with updating to 10.5 from 10.3 and getting "invalid signature" error

    I am trying to update to iTunes 10.5 so I can sync my new iPhone 4s but I keep getting the error message "invalid signature".  I have tried turning off firewall and antivirus as suggested on this forum to no avail.  Also going through Tools, Download

  • Boosting wireless signal....

    Hi, I am trying to help my parents out with their wireless internet. They live in a fairly large home that is made with adobe walls (a thick wall made of mud). While this is great for insulation, it makes their internet signal weak unless you are ver