Search:

Type: Posts; User: GregBrannon

Search: Search took 0.15 seconds.

  1. [SOLVED] Re: Put a random number from one vector to another

    You are where you were several posts ago. Same code, same errors, different method names. Short of writing this for you, I'm not sure how to reboot you so that you start rethinking what you're...
  2. [SOLVED] Re: Put a random number from one vector to another

    Something more like this:
    public static void main(String args[])
    {
    // i think you have M and N backwards, but I may not understand your comments
    int M =...
  3. [SOLVED] Re: Put a random number from one vector to another

    I suggest falling back and regrouping with a minor rethink, starting with the requirements. Sometimes we get set on a programming course not recognizing that we've either set out in the wrong...
  4. [SOLVED] Re: Put a random number from one vector to another

    You've analyzed the source of the error correctly: can't cram 10 pounds into a 5 pound sack. I also think the two arrays hold different types of data, and that's a problem. And I agree with your...
  5. [SOLVED] Re: Put a random number from one vector to another

    Okay, but I'm not sure it's the right way. If args[] only contains two values M and N, and they've already been extracted and parsed to the desired values, I'm not sure why you'd pass the args[]...
  6. [SOLVED] Re: Put a random number from one vector to another

    As I said pretty clearly, the necessary values or the whole array itself could be passed to the method:

    Change the call in main() to:
    int[] vectora = readfromargs( N, args );

    And change the...
  7. [SOLVED] Re: Put a random number from one vector to another

    The array args[] is local to the main() method, not within the scope of other methods even in the same class. Any values in args[] (or args itself) that are needed should be stored in other...
  8. [SOLVED] Re: Put a random number from one vector to another

    Give us example values for M and N.

    Are you sure the program isn't just waiting for data entry from the keyboard? Have you tried entering values after running? It might be helpful to add a...
Results 1 to 8 of 8