I'm trying to change my program to arrays so I can sort it

My program asks for 13 scores
oneString = JOptionPane.showInputDialog("Choose a test score 0-100");
          one = Integer.parseInt(oneString);
and so on till 13, then at the bottom I want to sort the 13 numbers so I can just take the highest and lowest to find the range. I have to have this in arrays so I can sort it using arrays.sort () method. I don't know where to make the numbers into arrays or how to start the #'s off as arrays. Could anyone tell me how?

I want to sort
the 13 numbers so I can just take the highest and
lowest to find the range.Sorting generally is a bad idea in this case. There's a very simple and straightforward algoritm available for finding the extreme values in a list of numbers. This is how to find the max value. Finding min is similar.
int max = list[0]; // first number is max so far
for (int i=1; i<list.length; i++) // all remaining numbers in list
   if (max < list) // current max is smaller than other number
max = list[i]: // so assign new max

Similar Messages

  • I'm trying to change the content of a tab. Can't find info anywhere! My new tab used to come up as Google search page. Now it is Bing, and I don't want Bing

    I'm trying to change the content of a tab. Can't find info anywhere! My new tab used to come up as Google search page. Now it is Bing, and I don't want Bing. I have uninstalled the program that inadvertently put it there but Bing remains. Where is the tab control that hooks me up with Tab content?

    Removal of dupe comment

  • Security question keep saying they are wrong and I know they are right. I can't change them cuz when I try it tells me to answer the questions. I have tried everything changing my account and all and still can't get it can some one please help me out.

    Security question keep saying they are wrong and I know they are right. I can't change them cuz when I try it tells me to answer the questions. I have tried everything changing my account and all and still can't get it can some one please help me out.

    Go here and select "Reset your password."  You will receive an email message with a link that bypasses the questions.  You will then be able to select and answer the questions again.

  • Trying to change reset my Apple ID as I can't remember it, however it is sending an email which says invalid link or a list with the option to change password which can't be clicked on? Can anybody please help?

    Trying to change reset my Apple ID as I can't remember it, however it is sending an email which says invalid link or a list with the option to change password which can't be clicked on? Can anybody please help? Going around in circles! Grrrrrrrrrrr

    Is this your machine or the company's?  Machines that came with Snow Leopard or earlier installed come with system and software install disks that can be used to reisntall the iApps that came with the machine orignally. 
    If this is your machine and it came with Snow Leopard or earlier installed the disk will look slimialr to one of these:
    If it is the company's machine see if they have the disks.
    Do a custom install and then use Software Update to update iPhoto to the highest version that is available.

  • I am trying to change my Apple ID password but it keeps telling me that my security answers are wrong

    I keep trying to change my Apple ID password but I can't get past the security questions. Is there another way to get thru because I don't remember my exact answer from 8 years ago.

    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.
    (107280)

  • In my dock there was this weird program called "tutorial". While throwing away this program I had to fill in my password. Afterwards I tried to change my password, but my old password doesn't work anymore. Who can help?

    In my dock there was this weird program called "tutorial". While throwing away this program I had to fill in my password. Afterwards I tried to change my password, but my old password doesn't work anymore. Who can help?

    What was this program for, or did you just assume it's something you shouldn't have and therefore arbitrarily decide to "throw it away"? Exactly how did you supposedly throw it away?
    If you didn't change your administrator password, there's no reason it shouldn't work now, so that suggests you did something else, or changed it and then forgot what it was.
    You can't recover that password; you can only change it. To do that, you would need to boot from your Snow Leopard DVD, choose your language, then choose Reset Password from the Utilities menu in the top menu bar.

  • Program keeps freezing when trying to change library or restore ipod.

    Having problems since updating like everyone else! Was missing files, etc.
    I am trying to change the library location in preferences, but the program locks up when it is opening the window. Also freezing when I try to add a folder to the library.
    I tried to restore my ipod on the summary page and same problem, opening window and it freezes. I have now reformatted my ipod and am trying to start fresh. Even reinstalled software, but no luck.
    Help!

    Me too .. very frustrating, spent the last 3 hrs looking for solutions.
    Also noticed Apple has suspended downloads of itunes 6 for the time being ... wondering if its a related bug.

  • Unable to make changes to a jpg file and then save it without the program trying to change it to a psd [was: What a Pile of Crap!]

    Can't even make changes to a jpg file and then save it without the program trying to change it to a psd!!!!!  No wonder nobody like Adobe anymore.

    Do you mean that PSD comes as a default option or that JPEG is not available no matter what?
    Did you add a layer?  Did you change the bit depth?  Did you add transparency?   The JPEG format does not support layers, nor 16-bit images, nor transparency.
    Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • HT5621 primary Apple ID is fine. Its the alt.Apple ID (an@me Myadress thats gives me and most all programs (mail) anfd apps ****. tried to change it but couldn't.help

    primary Apple ID is fine. Its the alt.Apple ID (an@me Myadress thats gives me and most all programs (mail) anfd apps ****. tried to change it but couldn't.help.
    <E-mail Edited by Host>

    You should be able to log out of the old version of the account on your iPad by tapping on it in Settings > iTunes & App Store and then log back in with the updated version - if the account is greyed out there then do you currently have Settings > General > Restrictions > Accounts (under the 'Allow Changes heading') set to 'Don't Allow Changes' ?

  • Trying to change the Tab size of SQL Server 2008 R2 ?

    Been trying to change the size of the tab but it just doesnt change!
    Went to Tools-Options-Text Editor-Transact-SQL
    From 2 to 1. 
    Any ideas? 

    Hi Shavendra,
    The Options dialog box lets you change the default behavior of the Database Engine Query Editor while you are programming Transact-SQL scripts. To display these settings, click Options on the Tools menu, expand the Text Editor folder, expand the Transact-SQL
    subfolder and then click Tabs.
    Tab size: Sets the distance in spaces between tab stops. The default is four spaces.
    Reference: http://msdn.microsoft.com/en-us/library/bb895215.aspx.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • I am trying to download a program off the internet.

    I am trying to download a program for school from this website http://snap2007.emcp.com/login/login.php It's telling me that I need internet explorer (which I have IE8) in order to download the training assessment I need for school. Does anyone know of a way I can download this program without changing firefox?

    You're welcome.
    Be aware that using the IE browser comes with all its vulnerabilities, so only use it on trusted websites.

  • While trying to change a BOM with transaction CS02, a runtime error appears

    While trying to change a BOM with transaction CS02, a runtime error appears.
    In intial screen he entered material ,plant BOM usage and date valid from  after executed then id displayed item list in that he wantu2019s delete one item, he has been deleted selected item after that when he was saving he is getting runtime error
    Developer trace
    ABAP Program SAPLKED1_WRITE_CE4_BPS1                 .
    Source LKED1_WRITE_CE4_BPS1U01                  Line 30.
    Error Code SAPSQL_ARRAY_INSERT_DUPREC.
    Module  $Id: //bas/640_REL/src/krn/runt/absapsql.c#17 $ SAP.
    Function HandleRsqlErrors Line 775.
    RABAX: level LEV_RX_STDERR completed.
    RABAX: level LEV_RX_RFC_ERROR entered.
    RABAX: level LEV_RX_RFC_ERROR completed.
    RABAX: level LEV_RX_RFC_CLOSE entered.
    RABAX: level LEV_RX_RFC_CLOSE completed.
    RABAX: level LEV_RX_IMC_ERROR entered.
    RABAX: level LEV_RX_IMC_ERROR completed.
    RABAX: level LEV_RX_DATASET_CLOSE entered.
    RABAX: level LEV_RX_DATASET_CLOSE completed.
    RABAX: level LEV_RX_RESET_SHMLOCKS entered.
    RABAX: level LEV_RX_RESET_SHMLOCKS completed.
    RABAX: level LEV_RX_ERROR_SAVE entered.
    RABAX: level LEV_RX_ERROR_SAVE completed.
    RABAX: level LEV_RX_ERROR_TPDA entered.
    RABAX: level LEV_RX_ERROR_TPDA completed.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI entered.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI completed.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP entered.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP completed.
    RABAX: level LEV_RX_END entered.
    RABAX: level LEV_RX_END completed.
    RABAX: end RX_RFC
    In sm21
    Perform rollback
    Run-time error "SAPSQL_ARRAY_INSERT_DUPREC" occurred
         Short dump "090618 110101 donalda 11557 " generated
    Runtime Error          SAPSQL_ARRAY_INSERT_DUPREC
    Exception              CX_SY_OPEN_SQL_DB
           Occurred on     18.06.2009 at   11:01:01
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKED1_WRITE_CE4_BPS1" had to be terminated because
    one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "RKE_WRITE_CE4__BPS1" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    How to correct the error
    The exception must either be prevented, caught within the procedure
    "RKE_WRITE_CE4__BPS1"
    "(FUNCTION)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    Use an ABAP/4 Open SQL array insert only if you are sure that none of
    the records passed already exists in the database.
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "SAPSQL_ARRAY_INSERT_DUPREC" CX_SY_OPEN_SQL_DBC
    "SAPLKED1_WRITE_CE4_BPS1" or "LKED1_WRITE_CE4_BPS1U01"
    "RKE_WRITE_CE4__BPS1"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    3. If the programs are your own programs or modified SAP programs,
       supply the source code.
       To do this, you can either use the "PRINT" command in the editor or
       print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error occurred
       or which actions and input led to the error.

    Hi ,
    you are getting beacuse u are trying to do mass update to database.
    Please check that below note are applicable to your system.
    Note 453313 - DBIF_RSQL_ERROR_INTERNAL for mass insert
    Note 869534 - AFS MRP doesn't work properly with all BOM item categories
    Thanks Rishi Abrol

  • Error message when trying to change Foreground/Background color

    Just in case anyone is having this problem in Photoshop CC where when you try to change/exchange or set to default the Background/Foreground colors and you get an error message of something like "Could not complete because of program error". I found the cure for this in an archive from when CS6 was in beta testing. Basically you have to delete the preferences file and restart the program. Here's a link to the article  http://forums.adobe.com/message/4336237. Apparently this "beta" problem can still occur as I am using the most recent version  of Photoshop CC.

    If you are trying to change the settings of your Router using the LELA software, and if you are getting an error message "Unable to Save the Data" its better you can exit from the LELA software and change all the Configuration settings on your Router Manaully.
    Open an Internet Explorer browser page on your wired computer(desktop).In the address bar type - 192.168.1.1 and press Enter...Leave Username blank & in Password use admin in lower case...
    For Wireless Settings,  Click on the Wireless tab
    Below you can make the changes on your Router ( SSID, Channel and let the SSID Broadcast should be Enable) and click on Save Settings... 
    For Wireless Security : -
    Click on the Sub tab under Wireless > Wireless Security...
    Change the security Mode to WPA Personal and under Passpharase type in your Security password and click on Save Settings.. 
    Once done, Now on your computer try to connect to your Wireless Network. Once connected you should be Online from your Computer. 

  • How do you change the program ALL files of a type open with?

    Hello. I run Parallels Desktop for Mac on this system. Since I upgraded to v3, OS X wants to open my Mac Word/Excel/Etc... files using the MS Office installed in windows XP from PD. I don't always have PD running, and do not want it to start up to use the programs on it. I know, not a Mac problem... But, my question is this:
    Is there a way to change the program that ALL files of a certain type (ex: pdf, doc, txt, etc...) will start? I have tried the OPT+RT CLICK which says to ALWAYS open this file with xxx.... but that only flags that single file. I want every file that I ever open anywhere on my system/network to use the program I specify. This is simple to do in Win XP, and I'm guessing there's a way to do it in OS X.
    Help/information appreciated.
    Thank you,
    Scott
    MacPro Quad Xeon 3.0GHz   Mac OS X (10.4.9)   16 GB RAM - 1TB Internal RAID1

    Well, with the program Onyx, I've found that LaunchServices database is the culprit. To fix this I just pick a type of file I want to change. Right click the file, choose get info, and change the program it opens with, then click the change all button. Done!
    Cool.
    Scott

  • "an error occurred when trying to change modules"

    When I switch repeatedly between Library and Develop with the R and E keys, I always sooner or later run into a problem where nothing happens when I press R. Really that should go the Develop module and enter crop mode -- what I'm usually trying to do, when this happens, is crop a bunch of photos. So I'll be using Library mode to identify the photos that need cropping, stepping through photos with the arrow keys, then when I find one that I want to crop, I press R, enter develop+crop mode, crop the photo, press E to return to library+loupe view, and continue.
    Sometimes this works 10 times, sometimes it only works twice, but always, relatively soon, when I press R, "nothing" will happen. Actually what's happening is an error dialog appears saying "an error occurred when trying to change modules", then the error dialog immediately disappears before I can read it. I know what it says, because if I click the Develop module with the mouse, I get the same message but it sticks around until I press OK.
    Once this happens, I'm entirely unable to use the Develop module until I quit the program. I had to quit and restart LR about 20 times during an hour of working with it last night, and this morning, in the first 15 minutes, I'm already on the 3rd restart.
    Anyone else see this?
    Details: LR 1.1 on Mac OS 10.4.10, 4-core Mac Pro, images are a mix of JPG from a pocket camera and NEF from a Nikon D40. I don't think it is related to the specific images, as it strikes apparently at random, and after exit and restart, I can crop that same photo, but a different one will eventually cause the same problem again.

    Sean, thanks for the Return key tip. I knew about that at one point, but lately I was trying to use Enter (the one on the numeric keypad, at the very lower right corner of the keyboard, which is really easy to hit with my thumb even when my hand is on the mouse! And Enter doesn't invoke the crop, so I forgot that Return did). That is a better way.
    I don't see the RE problem on my MacBook, only on my desktop computer, and that one is also experiencing other flakiness (
    metamatt, "missing text / thumbnails / many Lightroom UI elements disappeared" #, 18 Aug 2007 3:08 pm) so I think I'm going to try a complete reinstall there.

Maybe you are looking for