Debugging issues with one of my methods

public Elevator selectFloor()
    Scanner stdIn = new Scanner(System.in);
    int newFloor;
    newFloor = stdIn.nextInt();
    System.out.print("Enter the floor that you'd like to go to ==> ");
    If((newFloor >= 0 && newFloor <= 100)) //determines if the new floor is valid
       If(newFloor>this.floor)       //determines if the new floor is higher
          do
          newFloor--;
          System.out.print(newFloor + " ");
          } while (newFloor>this.floor)
       } //end if statement
       else
          do
          newFloor++;
          System.out.print(newFloor + " ");
          } while(newFloor<this.floor) //end do loop
       } // end else
    this.floor = newFloor;
    } // end if statement (input validification)
    else
       System.out.println
       ("Invalid floor selection - must be between 1 and 100.");
    } // end else
       return this;
} // end Elevator selectFloor class--------------------------------------------------------------------------------------------------------------------------------------------------
.\Elevator.java:24: ';' expected
If((newFloor >= 0 && newFloor <= 100)) //determines if the new floor is valid
^
.\Elevator.java:26: ';' expected
If(newFloor>this.floor) //determines if the new floor is higher
^
.\Elevator.java:32: ';' expected
} while (newFloor>this.floor)
^
.\Elevator.java:34: 'else' without 'if'
else
^
.\Elevator.java:40: ';' expected
} while(newFloor<this.floor) //end do loop
^
.\Elevator.java:44: 'else' without 'if'
else
^
.\Elevator.java:24: cannot find symbol
symbol : method If(boolean)
location: class Elevator
If((newFloor >= 0 && newFloor <= 100)) //determines if the new floor is valid
^
.\Elevator.java:26: cannot find symbol
symbol : method If(boolean)
location: class Elevator
If(newFloor>this.floor) //determines if the new floor is higher
^
8 errors
Tool completed with exit code 1
I've spent massive amounts of time trying to resolve the issues. I do not understand exactly why the program is giving me issues about requiring a boolean and why I would want a print statement at the end of a while loop, or what's deal is with the if statements. These are the error messages I get when I try to compile the driver I wrote for it.

Java is case sensitive. Keywords (like 'if') are not capitalized.
Do While loops require a semicolon after the while.
Sun provides tutorials on all of this.

Similar Messages

  • My 2007 Macbook pro Intel Core 2 Duo   Processor Speed 2.33 GHz has power issues with one or some of my USB powered devices. Last night I could not back up my Lacie external drives with software SuperDuper, hard drive copier. I also had a message that Tim

    My 2007 Macbook pro Intel Core 2 Duo   Processor Speed 2.33 GHz has power issues with one or some of my USB powered devices. Last night I could not back up my Lacie external drives with software SuperDuper, hard drive copier. I also had a message that Time machine failed. I have two powered 12V USB
    routers that are plugged into a 550VA CyberPower surge protector. I often receive these insufficient USB power for devices messages a dozen times even when I do not have devices like camera, Ipad, Ipod, and Tascam digital audio recorder plugged in. Is there a way to troubleshoot these USB routers or should I consider that one of the routers may be defective and replace them?
    David

    My 2007 Macbook pro Intel Core 2 Duo   Processor Speed 2.33 GHz has power issues with one or some of my USB powered devices. Last night I could not back up my Lacie external drives with software SuperDuper, hard drive copier. I also had a message that Time machine failed. I have two powered 12V USB
    routers that are plugged into a 550VA CyberPower surge protector. I often receive these insufficient USB power for devices messages a dozen times even when I do not have devices like camera, Ipad, Ipod, and Tascam digital audio recorder plugged in. Is there a way to troubleshoot these USB routers or should I consider that one of the routers may be defective and replace them?
    David

  • I have an older version of Firefox 3.6.6 I believe I am having an issue with one of the websites I sign into. Is there any way to update to the newest version

    I have an older version of Firefox 3.6.6 I believe I am having an issue with one of the websites I sign into. Is there any way to update to the newest version. Without losing all my bookmarks and saved pass words?

    Hello johngervais, the latest firefox version is 26.0 (today 4 Jan 2014).
    note that [https://support.mozilla.org/en-US/kb/firefox-no-longer-works-some-versions-windows-xp Firefox no longer works with some versions of Windows XP], if you have '''xp with sp2 and above''' you can update to latest version, see : [http://www.mozilla.org/en-US/firefox/26.0/system-requirements/ Firefox 26 System Requirements]
    if you are able to update to latest version then see : [https://support.mozilla.org/en-US/kb/common-questions-after-upgrading-firefox-36 Common questions after upgrading from Firefox 3.6]
    see also : [https://support.mozilla.org/en-US/kb/firefox-just-updated-why-it-asking-me-update-again Firefox just updated - why is it asking me to update again?]
    Don't worry you won't losing bookmarks and passwords after update firefox.
    thank you

  • I need to get the logs of my iPhone 5. I'm a registered as a developer and I have an issue with one of my app which is already in the market

    I need to get the logs of my iPhone 5. I'm a registered as a developer and I have an issue with one of my app which is already in the market

    The Firefox 3.5.x branch has reached end-of-life and is no longer maintained.<br />
    You will no longer receive security updates.<br />
    You can update Firefox via "Help > Check for Updates" or download and install the latest Firefox 3.6.x.<br />
    Firefox 4 and later require at least OS X 10.5 and an Intel Mac.
    * http://www.mozilla.com/firefox/4.0/system-requirements/
    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 3.6.x: http://www.mozilla.com/en-US/firefox/all-older.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • Dns issues with one domain (Resolved)

    i'm currently having dns issues with one domain, in that it won't resolve when I use bt's dns servers.
    The domain is owned by a friend in the US who runs his own server for irc, web, and I also have a server that is on his connection, and resolves fine from other machines on different networks, and also resolves fine when I set windows to use the opendns servers, but when it's set to either my routers ip (using bt's dns), or set to automatic (using bt's dns via the homehub), this one domain will not resolve.
    I'm pretty certain it's not a windows issue, as it's a clean install of windows 7 that I did yesterday. I've tried rebooting the homehub, and also flushing my dns on windows, but this has not solved the issue.
    As I say, it resolves fine on other networks, and also when I use the opendns servers, so I know it's definately a dns issue.
    Using bt's dns servers:
    C:\Users\admin>ping chatnsn.com
    Ping request could not find host chatnsn.com. Please check the name and try agai
    n.
    Using opendns:
    C:\Users\admin>ping chatnsn.com
    Pinging chatnsn.com [68.51.24.74] with 32 bytes of data:
    Request timed out.
    Request timed out.
    Request timed out.
    Request timed out.
    Ping statistics for 68.51.24.74:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
    (The timeouts are normal...he has his router set to not respond to ping requests).
    Has anyone got any ideas on how to sort this out? Preferably without having to phone the helpdesk...lets just say i've done it in the past, and according to the poeple I spoke to in india, I knew nothing about my own systems, and it was a problem at my end...which was not the case, and I proved this several times.
    Edit: This issue appears to have resolved itself, and the domain is now resolving again using the homehub for dns resolution.

    Hi,
    When NSLOOKUP starts, before anything else, it checks the computer's network configuration to determine the IP address of the DNS server that the computer uses.
    Then it does a reverse DNS lookup on that IP address to determine the name of the DNS server.
    If reverse DNS for that IP address is not setup correctly, then NSLOOKUP cannot determine the name associated with the IP address.
    http://support.simpledns.com/kb/a90/nslookup-cant-find-server-name___-default-server-unknown.aspx
    Also refer to:
    How to fix NSLOOKUP Default Server: UnKnown?
    http://www.randika.info/2013/01/how-to-fix-nslookup-default-server.html
    Regards.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Issue with a resultSet.wasNull() method

    Hello all
    I'm having a small issue with a resultset, basically i wanna test if it returns a null value but it does not seems to work.
    Its a simple application that pulls football matches data out of a database base on the provided data.
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
    String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
    PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
    ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){
    System.out.println("No data found");
    } else {
    System.out.println("Show all datas");
    }//rest of code
    } catch(SQLException e){
    }//rest of code
    the problem arises now, if i enter a data that its in the DB, its fine, all data's are pulled out and printed (via while(resMatch.next()........))
    If i enter a non existing data....nothing comes out, not even an exception.
    Any advice?
    Thx

    enrico wrote:
    This is my code, i would like to first say that, connectivity works fine, database existing, tables existing, if correct data's are inserted the application fetches the data with no problem.The code posted does not do that.
    >
    public void getMatch(GregorianCalendar cal){
    java.sql.Date sqlDate= new java.sql.Date(cal.getTimeInMillis());
    try{
         String resultMatch="SELECT resultMatch FROM matches WHERE date=?";
         PreparedStatement pre=connection.prepareStatement(resultMatch);
    pre.setDate(1,sqlDate);
         ResultSet resMatch=pre.executeQuery();
    if(resMatch.wasNull()){There is no way that the above code returns 'data' from the database.
    A result set represents a collection of zero or more rows.
    One must first retrieve a row before doing anything with it.
    The above code does not call next() so it absolutely does not retrieve any rows.
    The JDBC tutorial might help.
    http://download.oracle.com/javase/tutorial/jdbc/basics/

  • Issue with "firstRecord" Business Component method of JAVA Data bean API.

    Hi,
    Following is my use-case scenario:
    I have to add or associate child MVG business component (CUT_Address)
    with the parent business component (Account) using JAVA Data bean API.
    My requirement is: first to check whether child business component(i.e. CUT_address) exists. If it exists then associate it with parent business component (Account)
    otherwise create new CUT_address and associate it with account.
    Code (using JAVA Data bean APIs) Goes as follows:
    SiebelBusObject sBusObj = connBean.getBusObject("Account");
    parentBusComp = sBusObj.getBusComp("Account");
    SiebelBusComp parentBusComp;
    SiebelBusComp childBusComp;
    // retrieve required account.. Please assume Account1 exists
    parentBusComp.activateField("Name");
    parentBusComp.clearToQuery();
    parentBusComp.setSearchSpec("Name", "Account1");
    sBusComp.executeQuery2(true, true);
    sBusComp.firstRecord();
    Counter = 0;
    while (counter < Number_Of_Child_Records_To_Insert)
    childBusComp = parentBusComp.getMVGBusComp("City");
    associatedChildBusComp = childBusComp.getAssocBusComp();
    childBusComp.activateField("City");
    childBusComp.clearToQuery();
    childBusComp.setSearchSpec("City", Vector_of_city[counter]);
    sBusComp.executeQuery2(true, true);
    if( sBusComp.firstRecord() )
    // Child already exist and do processing accordingly
    else
    // Child does not exist and do processing accordingly
    childBusComp.release();
    childBusComp = null;
    associatedChildBusComp.release();
    associatedChildBusComp=null;
    Now the issue with this code is: For the first iteration, SbusComp.firstRecord returns 0 if records does not exist. However from the second iteration, SbusComp.firstRecord returns 1 even if there is no record matching the search specification.
    Any input towards the issue is highly appreciable.
    Thanks,
    Rohit.

    Setting the view mode to "AllView" helped.
    Thanks for the lead!
    In the end, I also had to invoke the business component method SetAdminMode with "true" as the argument so that I could also modify the records from my script.

  • Has anyone experience iMac memory issues with One Drive (previously Sky Drive) - uses 5GB of my 8GB memory!

    I recently started experiencing memory issues with my iMac due to One Drive using up to 5GB of my iMac memory (total of 8GB). Every time I start up my iMac Activity Monitor shows One Drive uses around 4-5Gb of the internal memory for no reason. Previously Onde Drive seemed to work fine, it's only since about 2 weeks I notice this. It's really annoying as the iMac freezes up regulalrly and I need One Drive to synchronise my files across different devices.
    Has anyone experienced this too and are there any known fixes?

    Yes this is happening to me too, since the last upgrade. Eventually MacOS starts insisting I "Force Quit" all my applications as I have run out of application memory.
    OneDrive doesn't appear in that list because it's not an application... but Activity Monotor clearly shows it's the culprit, taking up 5GB+ of RAM.
    I've raised the issue on Microsoft's forums:
    http://answers.microsoft.com/en-us/onedrive/forum/sdperformance-sdother/onedrive -for-macos-memory-leak/fe04cf60-949f-47b6-b886-10539b5c5cc3?tm=1397636232934

  • Issues with one of the 2 ISP links

    Hi,
    My tmg 2010 always had 2 ISP links and it worked ok with load balance (no issues at all). Recently I got another ISP link and changed with one of the previous working ones.
    Since then, the internet navigation seemed to work very well.. but some applications related to office 365 (lync and outlook) does not connect when the traffic is routed through this new ISP. The apps work with the first link but not with this new one. Without
    TMG, the apps do work on this new link!
    What can cause this?
    thanks.

    Hi, thanks for the reply.
    Yes, I removed the other ISP cable and the internet works well on this new link, except for some applications like lync and outlook (office 365).
    During TMG live log, there is no denied packets. I tried rebooting the firewall machine but still no success.
    things I tried without success with this new link:
    - change the NIC.
    - put a router between the link and the firewall and assign a private IP schema (our other link is routed to a private address. This new one is given directly at the interface).
    - create an excpetion to allow all traffic from a testing machine.
    Our l2tp/ipsec vpn (that always worked on both links) does not connect too on this new link. 
    That does not make sense at all.

  • Issues with one template

    Hello
    I'm having issues with Particle Impacts template - when I render video, it has like green lines like letter X all over the screen , like on the picture below
    http://i56.tinypic.com/bjed52.jpg
    How can I remove them? Thanks in advance

    Thanks a lot.
    I installed Video Copilot, Trapcode Particular and Cycore FX.It must be one of those.
    What you think which one it might be?

  • Issue with one of the Managed server while enabling SSL.__ Issue Resovled

    Weblogic version:wls 8.1sp6
    SSL: internal
    Environment:
    1 AdminServer and 2 Managed servers. Admin and M1 are on same host. M2 is on different host. We have enabled SSL on M1 & M2 only. Configuration of M1 & M2 are identical. After restarting the servers M1 has no issue with SSL but M2 throws javax.net.ssl.SSLKeyException as shown below,
    <Aug 4, 2008 12:29:01 PM BST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    <Aug 4, 2008 12:29:02 PM BST> <Info> <WebLogicServer> <BEA-000213> <Adding address: 10.96.201.249 to licensed client list>
    <Aug 4, 2008 12:29:09 PM BST> <Notice> <Security> <BEA-090171> <Loading the identity certificate stored under the alias wpy-euq02 from the JKS keystore file /home/lonwpyq/ssl_cert/WPY_PAYROLLSOLUTIONSKeystore.jks.>
    <Aug 4, 2008 12:29:09 PM BST> <Notice> <Security> <BEA-090170> <Loading the private key stored under the alias wpy-euq02 from the JKS keystore file /home/lonwpyq/ssl_cert/WPY_PAYROLLSOLUTIONSKeystore.jks.>
    <Aug 4, 2008 12:29:09 PM BST> <Warning> <Security> <BEA-090773> <The certificate chain received from lonlxwebhost99.lehman.com - 10.71.129.99 contained a V3 certificate which key usage constraints forbid its key use by the key agreement algorithm.>
    <Aug 4, 2008 12:29:09 PM BST> <Warning> <Security> <BEA-090773> <The certificate chain received from lonlxwebhost99.lehman.com - 10.71.129.99 contained a V3 certificate which key usage constraints forbid its key use by the key agreement algorithm.>
    <Aug 4, 2008 12:29:09 PM BST> <Warning> <Security> <BEA-090773> <The certificate chain received from lonlxwebhost99.lehman.com - 10.71.129.99 contained a V3 certificate which key usage constraints forbid its key use by the key agreement algorithm.>
    <Aug 4, 2008 12:29:09 PM BST> <Error> <Cluster> <BEA-000141> <TCP/IP socket failure occurred while fetching statedump over HTTP from -6401422690190304510S:lonlxwebhost99:[16544,16544,16042,16042,16544,16042,-1,0,0]:etg:lonwpyq_16543_1.
    javax.net.ssl.SSLKeyException: [Security:090773]The certificate chain received from lonlxwebhost99.lehman.com - 10.71.129.99 contained a V3 certificate which key usage constraints forbid its key use by the key agreement algorithm.
    at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireException(Unknown Source)
    at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertSent(Unknown Source)
    at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(Unknown Source)
    at com.certicom.tls.record.handshake.HandshakeHandler.fireAlert(Unknown Source)
    at com.certicom.tls.record.handshake.ClientStateReceivedServerHello.handle(Unknown Source)
    at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessage(Unknown Source)
    at com.certicom.tls.record.handshake.HandshakeHandler.handleHandshakeMessages(Unknown Source)
    at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown Source)
    at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
    at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
    at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
    at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknown Source)
    at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Unknown Source)
    at com.certicom.tls.record.WriteHandler.write(Unknown Source)
    at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown Source)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
    at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)
    at weblogic.net.http.HttpURLConnection.writeRequests(HttpURLConnection.java:122)
    at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:322)
    at weblogic.cluster.HTTPExecuteRequest.connect(HTTPExecuteRequest.java:73)
    at weblogic.cluster.HTTPExecuteRequest.execute(HTTPExecuteRequest.java:121)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)>
    Please let me know where I am going wrong. Thnx in advance
    Message was edited by:
    Shashi_sr

    Solution given by BEA Engineer:
    <Warning> <Security> <BEA-090773> <The certificate chain received from lonlxwebhost99.lehman.com - 10.71.129.99 contained a V3 certificate which key usage constraints forbid its key use by the key agreement algorithm.>
    The reason for this was
    The CA Certificate was missing a required bit (according to RFC 3280).
    keyEncipherment bit is not in the KeyUsage and KeyUsage is marked as critical.
    As per RFC:
    The keyEncipherment bit is asserted when the subject public key is
    used for key transport. For example, when an RSA key is to be
    used for key management, then this bit is set.
    According to RFC3280, when the key will be used to encrypt other keys that are send over the wire ("key transport") the keyEncipherment bit of the KeyUsage extension must be set. If the KeyUsage extension is critical, the SSL certificate validation will check that the key can be used in the key agreement. That is, that the key can be used to encrypt the symmetric public key.
    Your KeyUsage only contains the following bits:
    [4]: ObjectId: 2.5.29.15 Criticality=true KeyUsage [
    DigitalSignature
    Key_CertSign
    Crl_Sign
    Since it is marked Critical, it MUST have the keyEncipherment bit.
    Otherwise, it should not be marked as Critical.
    So the three solutions that should work are
    1) Remove keyUsage
    2) Don't mark keyUsage as critical
    3) If keyUsage is critical, make sure keyEncipherment bit is set.

  • Lync login issue with one domain but started working when domain is changed.

    we have two domains in lync 2013 infra.i have enabled user id with one domain but its not allowing user to login.If we change user id to other domain it start working. it seems user id already existed somewhere in lync or active directory database. can
    anyone tell how to remove complete user database so that the id can be assigned to other new users.

    Hi,
    Did the user account also be deleted or disabled in AD? Disable account is different form remove account. If you disable an account the account is still stored in AD, whenever you need to enable it you can find it. So if you only disable the account who
    leave the company, please remove the account and try again.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • ONEKEY IDEACENTRE PROBLEMS - issues with one key boot

    HI there.
    I've been reading about problems with onekey while having similar "free up buffer errors" and "please create a new base backup." messages coming up all the time. Every 1 to 4 days
    The message started coming up every 4 days and the base backup started taking 1hour then 2 hours,
    then the next time 3 hours.
    But I was not storing anymore data on my hard drive. In fact, I had freed up space by deleting some old files I didn't need.
    Anyway,
    Finally I decided to turn off Lenovo Backup, as many have suggested on this forum.
    My PC restarted no worries then onekey came up with a updating your system? And took 10 minutes to reach one percent! Then another 10 minutes to reach 2 percent.
    At that rate it would take 14 hours plus to update. That's ridiculous.
    Also I had turned onekey OFF.. not clicked on update my base back up so why the updating
    The API call must have failed or somethings buggy with onekey.
    At 6 percent (the one hour mark it was clear something was wrong with the speed of the update.)
    The PC was running fine in all respects other than onekey messages.
     I tried to boot to a recovery CD but no boot device worked before ONE key comes up with it's screen.
    Please could someone offer some suggestions, or PM me a way to bypass the one key at boot so I can do a clean reinstall back to factory settings. I've tried choosing the restore to factory image, from the LVT pre windows menu. But still it begins to update at 10 minutes per percent. A Solution may help others with similar onekey problems too.
    I'm now using my old backup PC.    
    I've seen a lot of PC issues, and this is a software issue, The hardware is fine and my PC is new.
    Something is up with onekey and the way it runs its software previous to windows booting, and the way the one key pre-OS does not allow the PC to boot from the CD DRIVE or USB DRIVE even if those devices are choosen as first boot options.
    Thank you very much,
    Gadget 
    PS. There must be a key combo or method to stop or bypass onekey running at boot rather then onekey bypassing all other normal and reasonable boot options so that I can use the restore CD and go back to the factory setup OS. Thanks again
    Message Edited by GADGET on 09-03-2008 05:44 AM
    Solved!
    Go to Solution.

    Hi Titan,
    Thanks for this. I'll look into it and see what the changelog says about OKRUPDATE_V3.EXE for next time. 
    To cut a long story short, after much discussion about the issue,  A very helpful person from Lenovo Tech support suggested we try system recovery (f2 key pre-windows) back to factory restore again, even though it had not worked the first time.
    Well the second time it worked. So I went back to factory install of image. I'll not use, for now, onekey restore until I know more about this new version of OKRUPDATE. But It's good to know its there and I'll look into OKRUPDATE_V3
    Hats of to the tech support person, and to you folks for your suggestions....
    Thanks....
    Problem solved.
    Gadget,
    PS. after doing the system recovery back to factory restore, the bios boot order now works too.
    Message Edited by GADGET on 09-04-2008 10:59 PM
    Message Edited by GADGET on 09-04-2008 11:06 PM

  • Something wrong with one of my methods

    Hi, im having a little trouble, I have a list of companies which I am storing in an arraylist an this is method below is simply suppose to display how many companies are in each state.
    Now, as long as I have the try/catch wrapped around the while loop it seems to function correctly, however if I take it out, the program throws an ArrayIndexOutOfBoundsException error. However I cannot see where it would be trying to access an index that isnt there.
         public static void compState(ArrayList companyMaker) {
              String[] component = {"WA","NSW","VIC","QLD","SA","ACT","TAS","NT"};
              int[] amount = new int[8];
              int n=0;
              try {
                   while (n <= component.length) {
                        System.out.print("\nThe companies in " + component[n] + ": ");
                        for (int i = 0; i < companyMaker.size(); i++) {
                             Company tempComp = (Company) companyMaker.get(i);
                             if (tempComp.getState().equalsIgnoreCase(component[n]))
                                  amount[n] += 1;
                        System.out.print(amount[n]);
                        n++;
              catch(Exception e) {}
         }Any help would be great, because I really dont want to leave it the way it is.

    i think thats a classical "off by one"-error
    you have to be careful with the array.length
    if you have an array with 8 elements, array.length would be 8, but the index starts with [0] and therefore ends with [7].
    try to replace this line:
    while (n <= component.length) with this one:
    while (n < component.length)

  • Debugging issue with WPF

    Hello,
      I am trying to debug some of my code for a set of WPF buttons.   I am stuck with an issue that I cannot get around.  When I launch the debugger from Visual Studio 2013, I get the following in the web browser:
    An error occurred in the application you were using
    You can try the following:
    Restart the application.
    Click the "More Information" link below for
    details about this error.
    Less Information
    <textarea cols="1" id="errorInfo" readonly="readonly" rows="1" style="width:752px;height:650px;display:block;" wrap="off">Startup URI: \\mrm2inc.com\Users\Michael.Mastro2\Documents\Visual
    Studio 2013\Projects\HomeInventoryWebForms\HomeInventoryWebForms\bin\Debug\HomeInventoryWebForms.xbap Application Identity: file://mrm2inc.com/Users/Michael.Mastro2/Documents/Visual%20Studio%202013/Projects/HomeInventoryWebForms/HomeInventoryWebForms/bin/Debug/HomeInventoryWebForms.xbap#HomeInventoryWebForms.xbap,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=fc075058c6cf26e0, processorArchitecture=msil/HomeInventoryWebForms.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fc075058c6cf26e0, processorArchitecture=msil, type=win32 System.Security.Policy.PolicyException:
    Execution permission cannot be acquired. at System.Runtime.Hosting.ApplicationActivator.CreateInstanceHelper(AppDomainSetup adSetup) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
    at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Activator.CreateInstance(ActivationContext activationContext) at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize() at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(String
    path, String fragment, MimeType mime, String debugSecurityZoneURL, String applicationId, Object streamContainer, Object ucomLoadIStream, HostingFlags hostingFlags, INativeProgressPage nativeProgressPage, String progressAssemblyName, String progressClassName,
    String errorAssemblyName, String errorClassName, IHostBrowser hostBrowser) ----------------------- PresentationHost.exe v4.0.41210.0 built by: Main - C:\Windows\SysWOW64\PresentationHost.exe ntdll.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\ntdll.dll
    KERNEL32.DLL v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\KERNEL32.DLL KERNELBASE.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\KERNELBASE.dll ADVAPI32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\ADVAPI32.dll
    USER32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\USER32.dll msvcrt.dll v7.0.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\msvcrt.dll ole32.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\ole32.dll OLEAUT32.dll
    v6.3.9600.17415 - C:\Windows\SYSTEM32\OLEAUT32.dll mscoree.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\mscoree.dll SHLWAPI.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\SHLWAPI.dll WININET.dll v11.00.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\WININET.dll urlmon.dll v11.00.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\urlmon.dll SHELL32.dll v6.3.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\SHELL32.dll sechost.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\sechost.dll RPCRT4.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\RPCRT4.dll GDI32.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\GDI32.dll combase.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\combase.dll iertutil.dll v11.00.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\iertutil.dll USERENV.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\USERENV.dll SspiCli.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\SspiCli.dll profapi.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\profapi.dll CRYPTBASE.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\CRYPTBASE.dll bcryptPrimitives.dll
    v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\bcryptPrimitives.dll IMM32.DLL v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\system32\IMM32.DLL MSCTF.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\MSCTF.dll shcore.dll
    v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\shcore.dll PresentationHost_v0400.dll v4.0.30319.33440 built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationHost_v0400.dll MSVCR120_CLR0400.dll v12.00.51670.34230
    built by: FX452RTMGDR - C:\Windows\SYSTEM32\MSVCR120_CLR0400.dll VERSION.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\VERSION.dll PSAPI.DLL v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\PSAPI.DLL kernel.appcore.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\kernel.appcore.dll uxtheme.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\uxtheme.dll ltc_help32-91954.dll v1, 0, 0, 1 - C:\PROGRA~2\Raptr\ltc_help32-91954.dll WINTRUST.dll v6.3.9600.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\WINTRUST.dll CRYPT32.dll v6.3.9600.16431 (winblue_gdr.131015-2301) - C:\Windows\SYSTEM32\CRYPT32.dll MSASN1.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\MSASN1.dll clbcatq.dll v2001.12.10530.17415
    (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\clbcatq.dll CRYPTSP.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\CRYPTSP.dll rsaenh.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\rsaenh.dll bcrypt.dll v6.3.9600.16384
    (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\bcrypt.dll ieproxy.dll v11.00.9600.17496 (winblue_r5.141121-1500) - C:\Program Files (x86)\Internet Explorer\ieproxy.dll PROPSYS.dll v7.00.9600.17031 (winblue_gdr.140221-1952) - C:\Windows\SYSTEM32\PROPSYS.dll
    dfshim.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\dfshim.dll mscoreei.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll clr.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Secur32.dll v6.3.9600.17415 (winblue_r4.141028-1500) - C:\Windows\SYSTEM32\Secur32.dll dwmapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\system32\dwmapi.dll msxml3.dll v8.110.9600.17415 - C:\Windows\System32\msxml3.dll actxprxy.dll v6.3.9600.17416
    (winblue_r4.141030-1500) - C:\Windows\SYSTEM32\actxprxy.dll sxs.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\sxs.dll PresentationHostProxy.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\PresentationHostProxy.dll
    comctl32.dll v6.10 (winblue_rtm.130821-1623) - C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17415_none_a9ed7f470139b3c1\comctl32.dll mscorlib.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\d03a3ddcd6a395878751c5e90fa16915\mscorlib.ni.dll
    System.ni.dll v4.0.30319.34239 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System\1a6b5095c4416a37f9ca4cf4436d1311\System.ni.dll WindowsBase.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\bb26d987467eca70ebc4beec29158d67\WindowsBase.ni.dll
    PresentationCore.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\24f6c80242420a1cea5cc254bf420027\PresentationCore.ni.dll PresentationFramework.ni.dll v4.0.30319.34209 - C:\Windows\assembly\NativeImages_v4.0.30319_32\Presentatio5ae0f00f#\4136b9a7a05c8f0e2c7e15600bc20b1b\PresentationFramework.ni.dll
    dwrite.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\dwrite.dll wpfgfx_v0400.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll PresentationNative_v0400.dll v4.0.30319.33440
    built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationNative_v0400.dll System.Xaml.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xaml\d626184834dde3f4906aff139d4e5bbf\System.Xaml.ni.dll
    clrjit.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll System.Xml.ni.dll v4.0.30319.34230 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\9a349fb029581f4752d2c6cfcfeab816\System.Xml.ni.dll
    System.Drawing.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Drawing\d91798a9a9fcb450351fe8e49026a69f\System.Drawing.ni.dll System.Windows.Forms.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Windows.Forms\a4d2243df4af8ab65ff74d436d449789\System.Windows.Forms.ni.dll
    System.Security.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Security\d72f65a6622be86134ba8c534acc10e5\System.Security.ni.dll System.Core.ni.dll v4.0.30319.34209 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Core\794a3d83e77a53d6fc029c389f9cc408\System.Core.ni.dll
    System.Deployment.ni.dll v4.0.30319.34243 built by: FX452RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Deployment\84fa9fa9c4be29612f8d268246a0353c\System.Deployment.ni.dll System.Configuration.ni.dll v4.0.30319.34209 built by: FX452RTMGDR
    - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Configuration\b5b80f1284dfa1b883da48ed58ecbc47\System.Configuration.ni.dll gpapi.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\gpapi.dll ncrypt.dll v6.3.9600.16384 (winblue_rtm.130821-1623)
    - C:\Windows\SYSTEM32\ncrypt.dll NTASN1.dll v6.3.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\SYSTEM32\NTASN1.dll diasymreader.dll v12.0.20806.33440 built by: FX45W81RTMREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll uiautomationcore.dll
    v7.2.9600.16384 (winblue_rtm.130821-1623) - C:\Windows\System32\uiautomationcore.dll </textarea>
    Anyone have any ideas how to get around this issue, or fix the issue?
    Michael R. Mastro II

    You need to be able to debug your code.
    This is a key ability.
    So key that this is the first thing you should be thinking about with any development ( which isn't trivial. ).
    Work out how to debug your application.
    Stick break points in there and explore what is going on.
    https://nirajrules.wordpress.com/2008/06/11/debugging-an-xbap-wcf-application-%E2%80%93-windows-vista-vsnet-2008/
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

Maybe you are looking for

  • Photo not found when publishing to .Mac

    Hi, I imported some photos from an external drive into iPhoto. Then I disconnected the external drive. Later when I tried to publish the newly imported photos to the .Mac gallery, I received an error that says the photos are not found and asks if I w

  • Scheduling not working correctly

    Ever since I installed the latest kernel 2.6.38.x, my system gets totally crippled when a high CPU process like an extraction of a big rar file gets started. The system loses all responsiveness: google doesn't respond anymore and even urxvt has troub

  • Vendor in Planned Delivery Costs

    Hi Is it possible to determine the vendor in a freight condition type? I would like to be able to enter vendor in condition maintenance, rather than having to adjust each PO item. Currently the PO vendor defaults into the conditions, and needs to be

  • Simple pass is not woking properly

    simple pass is not woking properly I am unable to sign into mails. when i click the web card a box appiars and it says set ur default browser my default browser is IE9   Ineed updates to solve this problem

  • Issue with CIF Integration model for Transaction data

    Hi Gurus, I have activated the Integration model for PO & PReqs by location wise and i assumed that transaction data is online and we need not to re activate for any new Product / location combination got created in system. But the issue is that ever