can any1 please tell me why the do-while loop wont work? im trying to use it to validate my program.
anytime a month appears it lets me enter any value i want when i want it to go back to the beginning if its out of the range of 0-744
please help :S
static void enterValues (double [] sunshine)
{
//create a Scanner object to read input
Scanner keyboard=new Scanner (System.in);
//Declare variable for loop counter and initialize
for (int count = 0; count < 12; count++)
do
{
//Prompt and input hours of sunshine for each month
System.out.print("Enter hours of sunshine for "+month[count]+" " );
sunshine [count] = keyboard.nextDouble();
}
while (sunshine[count]>0 && sunshine[count]<744);
}