Search:

Type: Posts; User: PCn3rd51

Search: Search took 0.11 seconds.

  1. [SOLVED] Re: Need help displaying the location of array index

    SOLVED! Figured it out last night but it works perfectly. I want to thank all who helped me. Feel free to test it out for yourselves \:D/



    import javax.swing.*;

    public class Homework4a {
    ...
  2. [SOLVED] Re: Need help displaying the location of array index

    Disregard my last post, wasn't thinking straight lol....



    for ( int arrayindex = 0 ; arrayindex < numarray.length ; arrayindex++ ) {

    numarray[arrayindex] != userinput;

    }
  3. [SOLVED] Re: Need help displaying the location of array index

    It seems a little redundant to nest 10 if statements to test that, is there an easier way of doing that?



    if ( userinput != numarray[1] ) {

    if userinput != numarray[2] ) {

    if...
  4. [SOLVED] Re: Need help displaying the location of array index

    well i would be one of the 10 random numbers. so how would i phrase my if statement if i want the userinput to not equal one of those 10 numbers?
  5. [SOLVED] Re: Need help displaying the location of array index

    All of you have been a big help. I fixed it so that it is now generating 10 random numbers every time the while loop starts. My only problem now is that its saying that int i needs to be initialized....
  6. [SOLVED] Re: Need help displaying the location of array index

    the code compiles and runs, but im not sure if its populating all 10 allocated spots.

    how can i test it to see if it does completely fill the array?

    If the number is negative or over 100 it...
  7. [SOLVED] Re: Need help displaying the location of array index

    yea it should populate the 10 random numbers. and keep on asking the user to guess the number, the numbers shouldn't change
  8. [SOLVED] Re: Need help displaying the location of array index

    isnt the for loop and math.random assigning random numbers to those locations? or should i just have the math.random only in the for loop?
  9. [SOLVED] Re: Need help displaying the location of array index

    "i" would be the random number that gets inserted into the 10 index locations
  10. [SOLVED] Re: Need help displaying the location of array index

    I have to create a variable that holds the index location? I didn't know that, how can i go about doing that? and where would i declare that variable?? I appreciate your help. Just keep in mind this...
  11. [SOLVED] Need help displaying the location of array index

    Hi all, just joined this forum and looking for a little advice with my code. My project was to create an array holding 10 integers and populate the array with 10 random numbers. Then ask the user to...
Results 1 to 11 of 11