Good luck.
Type: Posts; User: Norm
Good luck.
Sorry, I don't like working with messed up code.
Fix the formatting and put the user's input into the Scanner class's constructor as shown in post#14.
I bet you could have fixed the formatting in...
What does that mean? If I'm going to test the code, it matters to me.
Glad you got it working.
Where is the input to the program?
Replace
Scanner in = new Scanner (System.in);
with
Scanner in = new Scanner ("1/n2/n3/n4/n); //put valid user input in Scanner's constructor.
The code...
The normal way to search an array is with a loop with an if statement inside. Without seeing code that compiles and executes, I can't recommend much.
Can you make a small, complete program that compiles, executes and shows the problem for testing?
Be sure to add what input the user needs to make to execute the program.
That shows the first element of the array as 0.0. The array has no negative numbers.
Post the statement that has the error.
If the array has two dimensions, use the Array class's deepToString() method.
Print out its contents to be sure:
System.out.println("an ID "+ java.util.Arrays.toString(theArrayName));
0 is higher than either of those numbers. Are there any 0s in the array?
The code is very hard to read and understand because there are more than one statement on a line. Can you fix the code to...