Respuesta :
import java.util.Scanner;
public class JavaApplication60 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter a number in the twenties");
int num = scan.nextInt();
if(num >= 30 || num <= 19){
System.out.println("That's not in the twenties!");
num = 25;
}
System.out.println("Your number is " + num);
}
}
This is the complete code including the main class and main method. I hope this helps!
Debugging a code involves locating and correcting the errors in a code.
The error in the code segment is: invalid conditional statement
The conditional statement is given as: if (num 30)
The above condition is incorrect, because, there is no comparison operator between num and 30
The correct conditional statement is: if(num >= 30 || num<20)
So, the complete correct program is:
Scanner scan = new Scanner(System.in);
System.out.println("Enter a number in the twenties");
int num = scan.nextInt();
if(num >= 30 || num <20){
System.out.println("That's not in the twenties!");
num = 25;
}
System.out.println("Your number is " + num);
Read more about debugging at:
https://brainly.com/question/23527739