I need help with this part of code i am fairly new at coding so i am not that good below is the question Ask user to input a double(number), if the value entered is not a double it continues asking them until they enter a double. Once they enter a double it checks if the double entered is in the range (between 1-25). It will continue prompting until age1 is in that range.
Scanner input = new Scanner(System.in);
while(!input.hasNextDouble())
{
input.nextLine();
System.out.print("Input is not a number ReEnter:");
}
double age1 = input.nextDouble();
while (age1 < 1 || age1 > 25)
{
System.out.print( "Enter the Age between 1-25 Only!");
age1 = input.nextDouble();
}