Question: JAVA Question - If Else Continuation I have a successful if else statement. When the if is true, the input validation is finding an error.
JAVA Question - If Else Continuation
I have a successful if else statement. When the if is true, the input validation is finding an error.
This is using a module. I want it to ask for the input correctly again, so do I call the module in the if statement?
public static float getDur(float artDur) { Scanner sc= new Scanner(System.in); // input System.out.print("Please enter the art dur: "); float a = sc.nextInt(); if ((b < 0 || b > 59) && (b < 100 || b > 159)) {
system out println("input appropriate art duration") ;
// I WANT THE PROGRAM TO PROMPT FOR A RETRY
}
else {
// continue program
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
