Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    What does your post have to do with a user typing input into a computer????
  2. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    No user can compete with a computer for speed.
  3. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    For testing write a simple program with a loop that reads what you type in and prints it on the screen.

    Write a test program that times how long each techniques takes.

    You're wasting a lot of...
  4. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    What value does the variable need to have to get into the loop?
  5. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Read into a variable and print out the contents of the variable before using the data in the condition of a while loop. You need to see what read() returns.
  6. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Add some code to time it.
    What do you get in the array when you execute the code?
  7. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Have you found any other solutions than what have been posted so far?
  8. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Read the String, separate the words, convert the words to int, store the int in the next slot in the array.

    What do you mean by "most efficient"?
    Fewest lines of java code?
    Fastest execution...
  9. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    There are two parts to this:
    Read the input from the user
    Store the input into an array.


    That is the way it is done. Read a String, convert it to int, store it in the array.
  10. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Then the program will be getting Strings.
  11. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    If you are reading from the keyboard, you can not read integer values. Everything typed in is a character.
    How is the data entered for you to read? Is there a person at the keyboard that is entering...
  12. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    Sorry, where is the problem. You ask the user for the value of N and then read in N values from the user. All the values would have to be separated to be recognized as separate values.
  13. Replies
    29
    Views
    5,087

    Re: Input in a two Dimensional Array.

    When do you find out the value of 'N'?
    If the input record contains more than 'N' values, how will you know when you have enough and can ignore the rest of the values?
Results 1 to 13 of 13