Q:

How can i modify my program to ask me to replace a given number entered in an array because its not within a desired range

i am writing a java program, i want the user to enter 5 numbers within the range 10 and 100 if the user enters any number less than 10 or greater than 100, or a repeated number, it should ask me for a number to replace it with, but my program just puts a zero (0).so if i put any repeated number my program just stores it in the array as zero, i want it to ask me what number i want to replace it with then store the new number.
here's a segment of my code: 
 while (wahala < thearray.length) 
      {
          System.out.print("Enter the number you want: ");

           for (int w=0; w<5; w++)
           {
             value=input.nextInt();

          if (value>=10 && value<=100) 
          {

               boolean containsNumber = false;

               wahala++; 

                for(int j=0; j<thearray.length; j++)
                {
                    if (array[j]==value)
                    {
                        containsNumber=true;
                        break;
                    }

                }

                if (!containsNumber) 
                {

                    array[w]=value;
                    count++;
                } 
                else 
                    System.out.printf("%d has already been entered\n", value);
            } 
            else 
                System.out.println("Number must be between 10 and 100");
            }  

                for (int element: array)
                {
                  System.out.println(element +"");
                }
        }

A:

Nowhere in your sample code do you prompt the user for a new number.
Also, if the array has to avoid duplicates, consider using a Set instead, so that you can quickly check if a duplicate has been entered. 
Ex (Java 10):
private final int maxValues = 5;
private int input;

var intSet = new HashSet<Integer>();

while(intSet.size() < 5 && askedAndReceivedInput())
   if(intSet.contains(..some input))
     //ask again
   else
      intSet.put(someInput);

You can make the input-reading function however you wish..
Also please note that you're finding zeroes in your array because that's what java fills it with upon creation. It's the default value, this is guaranteed by the language spec.

