Problem 1 of 3  (Help Please!!!)

OK...here is my first problem. I am getting an error when i try to compile my sort number test program. Can anyone point out what i am doing wrong.
Here is the class file
public class SortFloat {
// Loops through each element of the array.
// Each time through, find the smallest remaining element, and move it
// to the first unsorted position in the array.
public static void SortFloat(double[] nums) {
for(int i = 0; i < nums.length; i++) {
int min = i; // holds the index of the smallest element
// find the smallest one between i and the end of the array
for(int j = i; j < nums.length; j++) {
if (nums[j] < nums[min]) min = j;
// swap the smallest one with element i.
// This leaves all elements between 0 and i sorted.
double tmp;
tmp = nums;
nums[i] = nums[min];
nums[min] = tmp;
Here is the test file
     public static void main(String[] args) {
double[] nums = new double[10]; // Create an array to hold numbers
for(int i = 0; i < nums.length; i++) // Generate random numbers
nums[i] = Math.random() * 100;
sort(nums); // Sort them
for(int i = 0; i < nums.length; i++) // Print them out
System.out.println(nums[i]);

Bizarro World Error Message Theory: Error messages, whether from the compiler or the runtime, are not your enemy. They are the friend you know will always be honest with you, even when it hurts. They're telling you something's going wrong. Don't panic. It can be fixed.
Moral: The compiler will tell you exactly what the error is, where the error is, and give you a good clue as to how to fix it. Don't expect others to sift through your code, searching for bugs. At least have the good form to tell them where the problem is.
That said, you're calling "sort(nums);" in your test main() method, but I don't see that method defined. Also, you've got a method in your SortFloat class that's named exactly the same thing as the class, but it's supposed to sort a double[] - use regular naming conventions and call it sortDouble(double[] d) or something... I didn't look at anything else that might be a problem - you can let us know what the compiler error is...
P.S. When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

Similar Messages

  • I recently purchased my first MacBook Air but am unable to set up my @live.ie email account. My emails to this account come through to my iphone no problem. Can anyone help please?

    I recently purchased my first MacBook Air but am unable to set up my @live.ie email account. My emails to this account come through to my iphone no problem. Can anyone help please?

    Open Mac Mail.
    From the menu bar click Mail > Preferencees then select the Accounts tab then the Account Information tab then click + to add the account.

  • In Iphoto 11 all 7000 of my photos show the same thumbnail.  I rebuilt the thumbnail using ctr alt and opening iPhoto. This worked and rebuilt the thumbnails correctly. Then when I reopened iPhoto the problem came back? Help please?

    In Iphoto 11 all 7000 of my photos show the same thumbnail.  I rebuilt the thumbnail using ctr alt and opening iPhoto. This worked and rebuilt the thumbnails correctly. Then when I reopened iPhoto the problem came back? Help please?

    Where is your Library stored?

  • My phone although fully charged has just switched itself off and won't turn back on again! I'm just coming to the end of a 2 year contract and never had any problems with it. Help please!

    My iPhone 4 although fully charges has just switched itself off and won't turn back on again. I've tried taking the sim card out but nothing happens. I'm just coming to the end of a 2 year contract and never had any problems with it before. Help please.

    Start here
    http://support.apple.com/kb/HT1430

  • Few problems... HELP PLEASE!!!

    Two things... one, my ipod will not connect to my computer. I haven't had this problem before. I can't even plug it in to restore the ipod to delete all files to start over.
    Two, how do you put your ipod into disk mode? A tech said I may have a corrupted file? How do I fix it? HELP PLEASE!!! I don't want to have to buy a new ipod and I use this thing all the time.

    Try Resetting Your iPod while it's connected to the computer.
    Hold down the Menu and Select buttons until you see the Apple logo (or Menu & Play/Pause in older models).
    This will often get it recognized. It may take several attempts.
    Also See:
    Your Windows PC doesn't recognize iPod
    iPod does not appear in iTunes or on the desktop
    iPod appears in Windows Explorer but does not appear in iTunes
    And: Putting iPod into Disk Mode

  • Problem with my Macbook - HELP PLEASE!!!!!!!!

    Hello, and please help!
    This is my second 1.83ghz 1 gb ram 80 gb hard drive Macbook. The first one mooed and had a buzzy display. This one has been perfect for three weeks. Have loved it. But today, my girlfriend shut it down, apparently properly, we took it out of it's case to use it and the fan was on FULL blast. Even though the computer was off! It then wouldn't turn on for ages. The macbook was very, very hot at this point.
    Eventually it restarted when the fan went off ten minutes later. The battery level had gone from 80% to 28%. And then it said 'Mac OS X unexpetedly quit' and carried on as normal.... for the moment.
    My girlfriend said 'it's done it once before' too.
    Any heads up on this? Many thanks in advance.
    Paddy

    It definitly sounds like she instructed the computer to shut down, but did not wait for the Mac OS to actually shut off the computer befre closing the lid. Doing so suspends activity and puts the computer into sleep mode where it still uses power. If you put the computer in a bag, the heat will build up, and I would expect it do do as you described.
    Ask your girlfriend if she waited for the screen to turn black or not. If she did wait for the screen to turn black, then you definitly have a problem that should be taken up with AppleCare, or Apple.
    If this post was helpful, please mark it as such.

  • Serious and Sudden Problem with Z10 NEED HELP PLEASE

    I have a z10, one of the first that came out in Toronto (if it makes a
    difference), a couple of hours ago I came across a serious and sudden
    problem.
    I was able to swipe left and right between pages of apps, even drop down
    from the top, but I cannot open anything, not even make a call or settings
    options.
    Any time I try to, for a split second it looks like its about to load
    something then nothing. (image slides to the right quickly and goes back on
    every attempt)
    So I first did a reset, same problem, then I did a battery pull (about 15 minutes) and problem presisted.
    I tried through USB to do a backup on blackberry manager and perhaps do a
    re-install of everything, however when I was prompted for the password of
    my device on my PC it kept telling me it was an incorrect password (I use
    this blackberry on my computer 4-7 days a week, twice a day sometimes for a
    year and I have never miss typed my password nor have i changed it)
    After trying everything to make sure the first letter maybe was upper/lower
    case, even my other possible phone password, nothing worked..
    On the 5th failed attempt my phone prompted me to type 'blackberry', which
    i did, then i typed my password on my phone which i type in about 15 times
    a day becuase I set my phone to a 5 minute lock and still said it was incorrect.... I am no on 9/10 attempts and lost
    for options.
    Please if anyone can give me any suggestions, or even how to backup my phone
    and whipe it now, or I have an earlier backup form 4 months ago that I
    wouldnt mind going back to in worst case scenario.
    Thank you for your help in advance,
    Solved!
    Go to Solution.

    Sorry, no I haven't experienced that. It could be from an app you downloaded but that's just a guess. Wiping the device will tell us a lot. If the device still doesn't work you'll want to reload the OS using BB Link. if it still doesn't work after that then warranty support will be necessary through Rogers.
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • Having problems with burning - need help please!

    when I try and burn a disk itunes says no recording
    software found. Everytime I start up itunes it says the drivers associated with burning are missing. It ask me to
    reinstall the software which I do and I have the same
    problem. I have other burning software but cant burn any
    itunes Ive purchased do to the format. Any help would be greatly appreciated.
    The german note is:
    Achtung
    Die Registrierungseinträge für die iTunes Treiber zum Import und Brennen von CDs und DVDs fehlen. Diese kann Folge der Installation einer anderen Software zum Brennen von CDs sein. Bitte installieren sie iTunes erneut.
    Could anybody please help me??

    I need more information about your hardware configuration. Run the iTunes Help menu -> Run CD Diagnostics... command and post the results here.
    I'm assuming that you're not running 64-bit windows.
    It sounds like the driver didn't get installed. You could try doing a repair install on iTunes --
    Windows Start menu -> Settings -> Control Panels -> Add or Remove Programs
    Select iTunes, Select Change/Remove button, Select "Repair" radio button, click OK.
    If that doesn't work, you might try downloading just the CD drivers from :
    http://www.gearsoftware.com/support/drivers.cfm
    Get the first link, not the second one that talks about gearsec compatibility.

  • TS3694 how to solve the problem 3194?? help please!!!!

    please help need to solve this problem, im running out of patience... tnx

    Hi,
    You have to say exactly how many columns will be in a result set.  If the number of columns depends on the data, then you need Dynamic SQL, which can be very complicated, error prone and inefficient..  Instead of exactly 2 rows and a variable number of columns, would you accept a variable number of rows with exactly 2 columns?
    How do you get the last column?  Why is the date 30-09-2014?  Why not 30-07-2014?
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002#9362002

  • Big word problems....help please !

    it seems the compatibility between mavericks and yosemite when using word is bad.....any word docs i try to work with now have issues after loading up yosemite....i cant page down to move the line of words down, the back button wont delete the space before.....like right now i try to page down and start writing a new line here but it just wont work !....i have tried to chreck this through word help and how compatabilty is used or turned on or off,secondly, it mentioned unicode within the document but i got out of my depth.....i have also tried to update for the mac from microsoft but after downloading it just said it couldnt save it to my mac hard drive....or any other drive,flashcard usb etc etc....***....frustrating.......word version is evidently 14.4.5 2010 (97 - 2011 ?) and mac is version 10.10 yosemite....    is there something i can do please ?.....thanks paul

    For problems with products made by MS you can also search/ask in the forums devoted to those:
    http://answers.microsoft.com/en-us/mac/forum/macword

  • After recent upgrades Firefox prevents links in several websites from working whilst there is no such problem with other browsers - help please.

    Since a recent upgrade of Firefox links in several websites no longer work. They used to be fine and I loved Firefox. The problems do not exist with other browsers e.g. Internet Explorer, Google Chrome. More specifically, on talktalk.co.uk the links to news items do not work, nor do those to "My Account." On Barclays.co.uk the link to print my statement doesn't work - similarly on MBNA.com
    There are several suggested solutions around the internet but all are complex, none so far have worked and I don't see why I should need to carry out the suggested tweaks. Firefox used to be great - now it isn't. The problem seems to be with the upgrade. Please help me to get my Firefox to where it should be.

    Thank you but please don't waste any more time on this. I have done as I said I would - removed and re- installed Firefox, cleared all cookies and caches (CCleaner) - still doesn't work. As I said at the start, the problem is not confined to Talktalk - it applies to several other sites and links. The problem does not occur with Internet Explorer nor with Google Chrome so I am now using those.

  • PROBLEM WITH MY MESSAGES HELP PLEASE!

    I am having a problem with my phone. If i save the number in my address book as normal...i.e 079 etc, when that number sends me a message it does NOT come up with a name just the number, BUT if i save the number in my address book as +44 when a text comes through the name WILL show but when the number rings the name wont, it just a number...does that make sense?! can anyone help me please...!

    Welcme to the Frums!
    I am not sure about the +44 stuff - someone with that experience will help ya on that one, but with my address book, I have to add the number then add a name then when they call, their name shows up.  
    Nurse-Berry
    Follow NurseBerry08 on Twitter

  • Mail Opening Problems & Setting up GoogleMail - Help Please

    I have just bought the new 24" iMac.
    I have imported my old email, no problem.
    When I open mail, the app opens but not the mail window, to do this I have to click 'New Viewer Window'. How do I get Mail to open as a window?
    I am also trying to set up my googlemail account.
    I have enabled IMAP in my googlemail and saved changes. I have chosen the Account Type IMAP, description 'GoogleMail', Incoming Mail Server: imap.googlemail.com, my googlemail email address, my googlemail password and clicked 'Continue'.
    The mail windows just says 'checking connection to mail server imap.googlemail.com...' but that is as far as it will go.
    Please will you help me to: when I click on 'Mail' the Mail window opens, and connect to googlemail?
    Thanks in anticipation

    Grrr again
    I said I had imported all my mail....WRONG!!!
    All the folders are there but no bloomin emails...could you help with how I import these from my old iMac to this new one via file sharing please

  • Problems installing Application Express  - Help Please

    Hi
    I have the personal edition of oracle and i have a database instance set up in entreprise manager. Now I'm trying to install application express to the database via SQL Plus. I run into two problems
    1. It says in the document that you need to log into SQL as SYS rather than SYSMAN, when I do log in as SYS i get the error message saying that I need to choose either SYSDBA or SYSOPER so I do rather than normal but I need a username/password to log in and I don't know what Username/password they are referring to. I tried a couple of usernames and passwords already and have been unsuccessful.
    2. So instead of logging in as SYS, I logged into the SQL Plus as SYSMAN. I load the apexin.sql file onto the SQL Plus and I push on execute. The it asks me to enter the 5 things, so i enter "password, SYSAUX, SYSAUX, temp, /i/" and i get the error message "SP2-0916: Scheme not supported"
    I have tried several times already. I am working off a toshiba Satellite P200 and it is windows Vista. What am I do wrong please HELP!
    Carol

    Hi there I'm still running into some trouble here
    When I am logged into my Enterprise Manager as SYS on my laptop
    I scroll to the bottom to open up iSQL plus and once I'm in, I get to the iSQL Plus Role Connection and there is 3 choices - 1) Normal 2) SYSOPER 3) SYSDBA
    I can log into normal with SYSMAN but when i choose SYS, it tells me that I must choose either SYSOPER or SYSDBA
    If I choose either of those, I get another login pop up saying that I need to log into the DBA system, but I don't know what username/password they are referring to. I tried logging into iSQL plus and tried executing sys/<sys password> as sysdba but it doesn't work. Please help!

  • Problems capturing VHS video - help please (Elements 11)

    I've tried without success trying to capture a VHS tape into Elements 11 for two hours now and really need some guidance please.
    The hardware is a Win 7 64 bit desptop and my VCR player is connected to the PC via a Canopus ADVC55 firewire connection, through an S-video and L/R audio inputs. The VHS tape is a Japanese one whihc plays fine through the VCR when it is connected directly to my TV.
    The capture process I'm trying to use is "DV Camcorder" but I keep getting an error message in the capture window stating that "Camera settings do not agree with project settings" and that the capture process may not work properly.
    To solve this I've tried almost all the NTSC settings in the New Project dialogue box. Sometimes the Canopus isn't recognised, sometimes it is but I get the above error message but nothing gets captured.
    I would have thought the correct project setting would be NTSC/DV/Standard 48kHz but i just get the error message. When I ticked the "force these settings for the project" box I got an immediate blue screen of death!
    I'm obviously doing something - or several things - that aren't right. I'd be very grateful if somebody could put me straight. All over the internet are articles saying how easy this VHS to DVD transfer is!!
    TIA. John.

    Thank you very much gentlemen for your help and advice. I've had a whale of a time this afternoon trying to make some sense of the problem.
    I've downloaded WinDV and updated the Firewire drivers. I've checked Device Manager and there is nothing there about dropped frames or timcodes. I've also tried every combination of the Canopus dipswitches making sure that I reboot bewteen setting changes. I've tried 2 different VHS players and also swapped out the cables. I've also found an old Miglia capture device and tried that as well in case the problem lies with the Canopus.
    The conclusions so far:-
    1. Using WinDV with the Canopus set to NTSC I get a picture straight away no problem and audio works as well. BUT the pictures are in black & white not colour.
    2. The Canopus doesn't pass the video through to WinDV with the dipswitches set to PAL - the status light stays red.
    3. So going back to elements 11 I've tried both dipswitch settings. With PAL the Canopus doesn't pass the signal through as for WinDV.
    4. With Elements 11 with the dipswitch set to NTSC and the New Project settings at PAL/HD/Standard 48kHz I get the error message about "Camera settings and Project settings being different" and my PC hangs completely.
    5. With Elements 11 with the dipswitches set to NTSC and the New Project settings at NTSC/HD/Standard 48kHz I get the message as above but if I close it then the "record" button is inactive and no video is recorded.
    6. And those results are the same for both VHS players.
    7. With The Miglia device I get no picture or sound with either WinDV or Elements 11 no matter what type of VHS tape I try to record.
    And that's as far as I've got.
    Are there any other Project settings I should try? Can anybody help with the Black and White issue with WinDV?
    I just want to get the VHS recorded via any piece of software now!
    Thanks again.

Maybe you are looking for

  • Application not working on CentOS platform...

    Hi, I have created an application in Java1.5. I am also using swingX library for Hyperlink control. I have tested my application on various platform i.e. windows xp, Fedora, Ubantu. Its working fine. But this is not working on CentOS v5 platform. I g

  • Can't download ANY files from web

    I have a mc ibook g4 with os 10.4.11. I have 2 accounts on the computer, one for myself and one for my wife. When I try to download a file from lets say download.com using my account, the file fails to download. When I change to my wife's account it

  • How to limit characters

    I've got DW8 retrieving a text chunk from SQL Server/ASP and I need to restrict it to the first 300 characters. Is there a way in DW to do this?

  • Am I missing out on higher potential speeds?

    I'm an existing Infinity customer on Option 2 - very close to the cabinet and have had an excellent ~38Mbps DL connection since I joined.  Having seen they are rolling out "Infinity 2" I wondered if I would be automatically upgraded to the faster ser

  • Docking station only maintains charge on T60

    Hello all. Just a quick question if anyone can help. I have a T60 which when attached to the docking station does not charge the battery, it only maintains the current battery state (i.e. it does not discharge but maintains the current "percentage" c