
Hi i would like this program:
public class ArrayApp { public static void main(String[]args) {
int [] arr;
arr= new int[100];
int nItems=0;
int j;
int searchId;
arr[0]= 11;
arr[1]= 22;
arr[2]= 33;
arr[3]= 44;
arr[4]= 55;
arr[5]= 66;
arr[6]= 77;
arr[7]= 88;
arr[8]= 99;
arr[9]= 00;
nItems= 10;
for (j=0; j<nItems; j++)
System.out.print(arr[j] + " ");
System.out.println(" ");
searchId = 66;
for (j=0; j<nItems; j++)
if (arr[j] == searchId)
break;
if (j == nItems)
System.out.println("Can't find" + searchId);
else
System.out.print("Found" + searchId);
searchId= 55;
for(j=0; j<nItems; j++)
if(arr[j] == searchId)
break;
for(int k=j; k>nItems; k--)
arr[k] = arr[k+1];
nItems--;
for(j=0; j<=nItems; j++)
System.out.print( arr[j] + " ");
System.out.println(" ");
}
} have the user input a number in the boxes.. if the number that the user input didn't match match with the number in the array boxes.. the output should be "Invalid Input" if it matches the number in the array boxes ([]) it should find the number and print it "Found (number)" pls. help me with this :)

Here is a code that input a number from user and find whether it exists in the array of numbers or not.
import java.util.*;
public class ArrayApp {
public static void main(String[]args) {
int [] arr;
arr= new int[100];
int nItems=0;
int j;
arr[0]= 11;
arr[1]= 22;
arr[2]= 33;
arr[3]= 44;
arr[4]= 55;
arr[5]= 66;
arr[6]= 77;
arr[7]= 88;
arr[8]= 99;
arr[9]= 00;
nItems= 10;
for (j=0; j<nItems; j++)
System.out.print(arr[j] + " ");
System.out.println(" ");
Scanner input=new Scanner(System.in);
System.out.print("Enter number to search: ");
int searchId = input.nextInt();
for (j=0; j<nItems; j++)
if (arr[j] == searchId)
break;
if (j == nItems)
System.out.println("Can't find: " + searchId);
else
System.out.print("Found" + searchId);
searchId= 55;
for(j=0; j<nItems; j++)
if(arr[j] == searchId)
break;
for(int k=j; k>nItems; k--)
arr[k] = arr[k+1];
nItems--;
for(j=0; j<=nItems; j++)
System.out.print( arr[j] + " ");
System.out.println(" ");
}
}

Hello i already solved the problem my self.. But i didn't use scanner because i don't know it's use. so i just replace the searchId=66; with an input.reaLine And it works.. maybe you can explain what is the use of the scanner that u have put in there thanks

The Scanner class is a class in java.util, which allows the user to read values of various types. There are far more methods in class Scanner than you will need in this course. We only cover a small useful subset, ones that allow us to read in numeric values from either the keyboard or file without having to convert them from strings and determine if there are more values to be read.

Well, Thanks! :D the only one i need to knows is.. when i run the program i have made the output is this:
11 22 33 44 55 66 77 88 99 00 Enter number: 99 Found: 99 11 22 33 44 55 66 77 88 00
I know the program deleted the value i enter it is because it is made to do so.. but i don't know how does it work.. as you can see.. the first program i posted needs to be edited so the user can input a number and delete it in the array, so how come the program delete the number that the user input? I need to know that because no one in our class can answer the question.. I know that the deletion part happens in the lower part of the program which is the "search= 55;" is located but i need more information. Please help me :)