SEARCH YOUR SOLUTION HERE  

Data Validation within a for loop?

Is that possible
I need to prompt the user a set number of times, but they cannot enter a number less than zero. How do I do this
This is where I am trying to add that in my code ( but do not have any data validation because I am not sure how to do so in a for loop )

for ( ; y < order; y++ ) { System.out.println ( "Please enter the number of burgers: " ); burgers = input.nextInt (); System.out.println ( "Please enter the number of fries: " ); fries = input.nextInt (); System.out.println ( "Please enter the number of drinks: " ); }

Posted On: Thursday 29th of November 2012 08:29:45 PM Total Views:  2025
View Complete with Replies




Related Messages:

No releated messages found!!!